c# - Exception on call hangup for landline phone -



c# - Exception on call hangup for landline phone -

i developing software landline phones , full-duplex voice modems using c# , tapi 3 library. phone call answering working fine phone call hangup throwing exception. did lot of search find solution not. next errors:

exception occurring on calling method ici.releaseuseruserinfo(); {"this implementation doesn't take advises (exception hresult: 0x80040003 (ole_e_advisenotsupported))"} system.exception {system.runtime.interopservices.comexception}"

my goal save recorded calls. 1 interesting thing if, before phone call hangup, close application, saves recorded call.

my code:

private void btnanswer_click(object sender, eventargs e) { ienumcall ec = ia[line].enumeratecalls(); uint arg = 0; itcallinfo ici; itterminal recordterminal;//ny test record seek { ec.next(1, out ici, ref arg); itbasiccallcontrol2 bc = (tapi3lib.itbasiccallcontrol2)ici; recordterminal = bc.requestterminal(tapiconstants.clsid_string_filerecordingterminal, tapiconstants.tapimediatype_multitrack, tapi3lib.terminal_direction.td_render); itmediacontrol mediacontrol = (itmediacontrol)recordterminal; itmediarecord mediarecord = (itmediarecord)recordterminal; mediarecord.filename = "a.wav"; bc.selectterminaloncall(recordterminal); bc.answer(); mediacontrol.start(); } grab (exception exp) { messagebox.show("there may not calls answer! \n\n" + exp.tostring(), "tapi3"); } } private void btnhang_click(object sender, eventargs e) { ienumcall ec = ia[line].enumeratecalls(); uint arg = 0; itcallinfo ici; seek { ec.next(1, out ici, ref arg); itbasiccallcontrol bc = (itbasiccallcontrol)ici; bc.disconnect(disconnect_code.dc_normal); ici.releaseuseruserinfo(); } grab (exception exp) { messagebox.show("no phone call disconnect!", "tapi3"); } }

i believe error code you're seeing tapi_e_notsupported!

according msdn documentation itcallinfo::releaseuseruserinfo:

the releaseuseruserinfo method informs service provider application has processed user-user info obtained itcallinfo::getcallinfobuffer method, called cib_useruserinfo fellow member of callinfo_buffer, , subsequently received user-user info can written.

hwoever, user-user information specific isdn q.931 standard , not service providers back upwards it.

unless want exchange info between client , remote end, sufficient delete offending line of code, otherwise both unused , unsupported.

c# tapi

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -