Author Topic: OCX with C#  (Read 14160 times)

Offline elogic

  • newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
OCX with C#
« on: November 16, 2006, 09:05:16 AM »
Hi,

I imported ocx control as dll and created a instance of namepace and class in code behind file.

i can see all the functions and proerties by intellisense.

but when i access thru browser i am getting following error.

Culture name \'neutral\' is not supported


is that related to my application or am i doing anything wrong,

first i want to know whether i can use that ocx as dll or assembly in asp.net 2.0


any help plz...

Thanks
Sanju
System.ArgumentException: Culture name \'neutral\' is not supported. Parameter name: name at System.Globalization.CultureTableRecord..ctor(String cultureName, Boolean useUserOverride) at System.Globalization.CultureTableRecord.GetCultureTableRecord(String name, Boolean useUserOverride) at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) at System.Reflection.Assembly.GetName(Boolean copiedName) at System.Reflection.Assembly.GetName() at System.ComponentModel.Design.RuntimeLicenseContext.CaseInsensitiveManifestResourceStreamLookup(Assembly satellite, String name) at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly) at System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32& fDesignTime, IntPtr& bstrKey, RuntimeTypeHandle rth) at web2fone.Page_Load(Object sender, EventArgs e) in
« Last Edit: January 01, 1970, 05:00:00 AM by elogic »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
C# sample
« Reply #1 on: January 10, 2007, 01:19:56 PM »
Hi,

Download this C# sample from my IAX work page.
http://www.silicontechnix.com/babarnazm ... ation4.zip
Or
Find the attached file for C# sample.

Regards,
Babar Shafiq Nazmi.
« Last Edit: December 09, 2010, 01:42:19 PM by Babar Shafiq Nazmi »
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #2 on: December 09, 2010, 12:58:26 PM »
Dear Babar
The Link is here for C# is damaged. please send me the sample to me by email.
really Thanks
madjidashtar@gmail.com

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #3 on: December 09, 2010, 01:37:19 PM »
Hi, Sorry it was link issue, check now
Also it is attached in this post http://silicontechnix.com/forum/iaxclient/ocx-with-c/msg226/#msg2267

Babar Shafiq Nazmi
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #4 on: December 09, 2010, 02:30:49 PM »
hi Dear Babar
Your OCX has a problem to connect to our asterisk server by registration by introducing the IP address.
Is it possible to offer port No to server?
Our VS version is 2005. Is it compatible with yours?
really thanks
« Last Edit: December 09, 2010, 02:42:40 PM by majid »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #5 on: December 09, 2010, 02:47:22 PM »
Yes, you need to open 4569 UDP port in your firewall from your network and it must be enable on your remote server, verify.

Also you can change the source (client system port) and destination (server side) ports from IAX control properties.
Quote
.ListenPort = numeric_value
.IAX2Port= numeric_value


Babar Shafiq Nazmi
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #6 on: December 09, 2010, 03:01:56 PM »
Hi Dear Babar
The other soft-phone is working properly with UDP port 4569.
But your OCX properties hasn't these .ListenPort = numeric_value
.IAX2Port= numeric_value codes.
what can I do to complete registration with server with your OCX?
Really Thanks

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #7 on: December 09, 2010, 03:13:54 PM »
sorry its IAXPort. it  is available in the last version available on this forum
ListenPort is available in new version which I will update shortly

First you need to provide those values to the control

Quote
.HostName = xxx.xxx.xxx.xxx
.UserID = xxxx
.Password = xxxx

Then call .InitIAX() and then you need to call .Register()
that will register your application to asterisk.

BR,
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #8 on: December 09, 2010, 04:13:04 PM »
Hi
Where is the link for latest version of C# IAXOCX which has these two .Listenport and .IAXport properties?
Really Thanks.

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #9 on: December 09, 2010, 04:35:25 PM »
You can download last version from here:-
Quote
http://www.silicontechnix.com/iaxcontrol/latest/
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #10 on: December 09, 2010, 05:01:14 PM »
Hi Dear
I check the last version of OCX, but I couldn't find the .IAXPort and .listenPort properties in the control.
Although there are the .Hostname, .UserID, .Passwd, and .Register actually.
I did imported the new OCX(2.0.0.72) to my project and see all properties.
Then you think where is my fault to finding those properties, please.
Really Thanks
« Last Edit: December 09, 2010, 05:07:25 PM by majid »

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #11 on: December 09, 2010, 05:19:00 PM »
.IAXPort is available in version 2.0.0.72 already. Just verified.
.ListenPort will be available in new coming version.
But without settings .IAXPort your application should register to Asterisk, must be some mistake in your code.
Please share your code so I can tell you what exactly is the issue.

BR,
Babar Shafiq Nazmi
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #12 on: December 09, 2010, 05:29:09 PM »
Hi
 on Dial button we have these codes:
private void button1_Click(object sender, System.EventArgs e)
      {
         axIaxClientOcx1.UserID=txtuserid.Text;
         axIaxClientOcx1.Password=txtpassword.Text;
         axIaxClientOcx1.HostName=txthostname.Text;
         axIaxClientOcx1.PhoneNumber=txtphone.Text;
                        axIaxClientOcx1.IAXPort = 4569; //new line for edit
         axIaxClientOcx1.Dial();
      }

Error   1   'AxIAXCLIENTOCXLib.AxIaxClientOcx' does not contain a definition for 'IAXPort'
 
Really Thanks

Offline Babar Shafiq Nazmi

  • Administrator
  • Senior Member
  • *****
  • Posts: 153
  • Karma: +87/-0
    • View Profile
    • Silicon Technix
Re: OCX with C#
« Reply #13 on: December 09, 2010, 05:41:54 PM »
Looks like version conflict, make sure you are using 2.0.0.72, un-register the current vesion in your pc , download the latest, register it again and check.

Quote
to unregister
regsvr32 /u iaxclientocx.ocx
(include path to control, if not available on root directory)

to register
regsvr32 iaxclientocx.ocx

Also you are not calling
axIaxClientOcx1.Register();
so it will not register to Asterisk box, just dial the call with the userid,password provided.

BR,
Babar Shafiq Nazmi
« Last Edit: December 12, 2010, 01:50:53 PM by Babar Shafiq Nazmi »
....God is the greatest Programmer....

http://www.silicontechnix.com

Offline majid

  • Regular Memeber
  • ***
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OCX with C#
« Reply #14 on: December 09, 2010, 07:20:46 PM »
Hi
I don't know where i must "regsvc /u iaxclientocx.ocx" or unregister it in my PC.
Could you please send me the last IAXOCX to my email for more confidence.
madjidashtar@gmail.com
Really Thanks
« Last Edit: December 09, 2010, 07:26:05 PM by majid »