ckudia.c 235 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249
  1. #include "ckcsym.h"
  2. char *dialv = "Dial Command, 9.0.161, 4 Feb 2016";
  3. /* C K U D I A -- Module for automatic modem dialing. */
  4. /*
  5. Copyright (C) 1985, 2016,
  6. Trustees of Columbia University in the City of New York.
  7. All rights reserved. See the C-Kermit COPYING.TXT file or the
  8. copyright text in the ckcmai.c module for disclaimer and permissions.
  9. */
  10. /*
  11. Authors:
  12. Original (version 1, 1985) author: Herm Fischer, Encino, CA.
  13. Contributed to Columbia University in 1985 for inclusion in C-Kermit 4.0.
  14. Author and maintainer since 1985: Frank da Cruz, fdc@columbia.edu.
  15. Contributions by many others throughout the years, including: Jeffrey
  16. Altman, Mark Berryman, Fernando Cabral, John Chmielewski, Joe Doupnik,
  17. Richard Hill, Larry Jacobs, Eric Jones, Tom Kloos, Bob Larson, Peter Mauzey,
  18. Joe Orost, Kevin O'Gorman, Kai Uwe Rommel, Dan Schullman, Warren Tucker, and
  19. many others.
  20. */
  21. /*
  22. Entry points:
  23. ckdial(char * number) Dial a number or answer a call
  24. dialhup() Hang up a dialed connection
  25. mdmhup() Use modem commands to hang up
  26. All other routines are static.
  27. Don't call dialhup() or mdmhup() without first calling ckdial().
  28. */
  29. /*
  30. This module calls externally defined system-dependent functions for
  31. communications i/o, as described in CKCPLM.DOC, the C-Kermit Program Logic
  32. Manual, and thus should be portable to all systems that implement those
  33. functions, and where alarm() and signal() work.
  34. HOW TO ADD SUPPORT FOR ANOTHER MODEM:
  35. 1. In ckuusr.h, define a modem-type number symbol (n_XXX) for the new modem,
  36. the next highest one.
  37. 2. In ckuusr.h, adjust MAX_MDM to the new number of modem types.
  38. The remaining steps are in this module:
  39. 3. Create a MDMINF structure for it. NOTE: The wake_str should include
  40. all invariant setup info, e.g. enable result codes, BREAK transparency,
  41. modulation negotiation, etc. See ckcker.h for MDMINF struct definition.
  42. 4. Add the address of the MDMINF structure to the modemp[] array,
  43. according to the numerical value of the modem-type number.
  44. 5. Add the user-visible (SET MODEM) name and corresponding modem number
  45. to the mdmtab[] array, in alphabetical order by modem-name string.
  46. 6. If this falls into a class like is_rockwell, is_supra, etc, add the new
  47. one to the definition of the class.
  48. 7. Adjust the gethrn() routine to account for any special numeric result
  49. codes (if it's a Hayes compatible modem).
  50. 8. Read through the code and add any modem-specific sections as necessary.
  51. For most modern Hayes-compatible modems, no specific code will be
  52. needed.
  53. NOTE: The MINIDIAL symbol is used to build this module to include support
  54. for only a minimum number of standard and/or generally useful modem types,
  55. namely Hayes 1200 and 2400, ITU-T (CCITT) V.25bis and V.25ter (V.250),
  56. Generic-High-Speed, "Unknown", and None. When adding support for a new
  57. modem type, keep it outside of the MINIDIAL sections unless it deserves to
  58. be in it.
  59. */
  60. #include "ckcdeb.h"
  61. #ifndef NOLOCAL
  62. #ifndef NODIAL
  63. #ifndef NOICP
  64. #ifndef CK_ATDT
  65. #define CK_ATDT
  66. #endif /* CK_ATDT */
  67. #ifndef NOOLDMODEMS /* Unless instructed otherwise, */
  68. #define OLDMODEMS /* keep support for old modems. */
  69. #endif /* NOOLDMODEMS */
  70. #ifndef M_OLD /* Hide old modem keywords in SET MODEM table. */
  71. #define M_OLD 0 /* Define as CM_INV to make them invisible. */
  72. #endif /* M_OLD */
  73. #ifndef M_ALIAS
  74. #define M_ALIAS 64
  75. #endif /* M_ALIAS */
  76. #ifndef MAC
  77. #include <signal.h>
  78. #endif /* MAC */
  79. #include "ckcasc.h"
  80. #include "ckcker.h"
  81. #include "ckucmd.h"
  82. #include "ckcnet.h"
  83. #include "ckuusr.h"
  84. #ifdef OS2ONLY
  85. #define INCL_VIO /* Needed for ckocon.h */
  86. #include <os2.h>
  87. #undef COMMENT
  88. #include "ckocon.h"
  89. #endif /* OS2ONLY */
  90. #ifdef NT
  91. #include <windows.h>
  92. #include <tapi.h>
  93. #include "cknwin.h"
  94. #include "ckntap.h"
  95. #endif /* NT */
  96. #ifdef OS2
  97. #include "ckowin.h"
  98. #endif /* OS2 */
  99. #ifndef ZILOG
  100. #ifdef NT
  101. #include <setjmpex.h>
  102. #else /* NT */
  103. #include <setjmp.h>
  104. #endif /* NT */
  105. #else
  106. #include <setret.h>
  107. #endif /* ZILOG */
  108. #include "ckcsig.h" /* C-Kermit signal processing */
  109. #ifdef MAC
  110. #define signal msignal
  111. #define SIGTYP long
  112. #define alarm malarm
  113. #define SIG_IGN 0
  114. #define SIGALRM 1
  115. #define SIGINT 2
  116. SIGTYP (*msignal(int type, SIGTYP (*func)(int)))(int);
  117. #endif /* MAC */
  118. #ifdef AMIGA
  119. #define signal asignal
  120. #define alarm aalarm
  121. #define SIGALRM (_NUMSIG+1)
  122. #define SIGTYP void
  123. SIGTYP (*asignal(int type, SIGTYP (*func)(int)))(int);
  124. unsigned aalarm(unsigned);
  125. #endif /* AMIGA */
  126. #ifdef STRATUS
  127. /*
  128. VOS doesn't have alarm(), but it does have some things we can work with.
  129. However, we have to catch all the signals in one place to do this, so
  130. we intercept the signal() routine and call it from our own replacement.
  131. */
  132. #define signal vsignal
  133. #define alarm valarm
  134. SIGTYP (*vsignal(int type, SIGTYP (*func)(int)))(int);
  135. int valarm(int interval);
  136. #ifdef putchar
  137. #undef putchar
  138. #endif /* putchar */
  139. #define putchar(x) conoc(x)
  140. #ifdef getchar
  141. #undef getchar
  142. #endif /* getchar */
  143. #define getchar(x) coninc(0)
  144. #endif /* STRATUS */
  145. #ifdef OS2
  146. #ifdef putchar
  147. #undef putchar
  148. #endif /* putchar */
  149. #define putchar(x) conoc(x)
  150. #endif /* OS2 */
  151. #ifndef NOHINTS
  152. extern int hints;
  153. #endif /* NOHINTS */
  154. #ifdef CK_TAPI
  155. extern int tttapi;
  156. extern int tapipass;
  157. #endif /* CK_TAPI */
  158. #ifdef CKLOGDIAL
  159. extern int dialog;
  160. #endif /* CKLOGDIAL */
  161. char * dialmsg[] = { /* DIAL status strings */
  162. /* Keyed to numbers defined in ckcker.h -- keep in sync! */
  163. "DIAL succeeded", /* 0 DIA_OK */
  164. "Modem type not specified", /* 1 DIA_NOMO */
  165. "Communication device not specified", /* 2 DIA_NOLI */
  166. "Communication device can't be opened", /* 3 DIA_OPEN */
  167. "Speed not specified", /* 4 DIA_NOSP */
  168. "Pre-DIAL hangup failed", /* 5 DIA_HANG */
  169. "Internal error", /* 6 DIA_IE */
  170. "Device input/output error", /* 7 DIA_IO */
  171. "DIAL TIMEOUT expired", /* 8 DIA_TIMO */
  172. "Interrupted by user", /* 9 DIA_INTR */
  173. "Modem not ready", /* 10 DIA_NRDY */
  174. "Partial dial OK", /* 11 DIA_PART */
  175. "Dial directory lookup error", /* 12 DIA_DIR */
  176. "Hangup OK", /* 13 DIA_HUP */
  177. NULL, /* 14 (undef) */
  178. NULL, /* 15 (undef) */
  179. NULL, /* 16 (undef) */
  180. NULL, /* 17 (undef) */
  181. NULL, /* 18 (undef) */
  182. "No response from modem", /* 19 DIA_NRSP */
  183. "Modem command error", /* 20 DIA_ERR */
  184. "Failure to initialize modem", /* 21 DIA_NOIN */
  185. "Phone busy", /* 22 DIA_BUSY */
  186. "No carrier", /* 23 DIA_NOCA */
  187. "No dialtone", /* 24 DIA_NODT */
  188. "Incoming call", /* 25 DIA_RING */
  189. "No answer", /* 26 DIA_NOAN */
  190. "Disconnected", /* 27 DIA_DISC */
  191. "Answered by voice", /* 28 DIA_VOIC */
  192. "Access denied / forbidden call", /* 29 DIA_NOAC */
  193. "Blacklisted", /* 30 DIA_BLCK */
  194. "Delayed", /* 31 DIA_DELA */
  195. "Fax connection", /* 32 DIA_FAX */
  196. "Digital line", /* 33 DIA_DIGI */
  197. "TAPI dialing failure", /* 34 DIA_TAPI */
  198. NULL /* 34 */
  199. };
  200. #ifdef COMMENT
  201. #ifdef NOSPL
  202. static
  203. #endif /* NOSPL */
  204. char modemmsg[128] = { NUL, NUL }; /* DIAL response from modem */
  205. #endif /* COMMENT */
  206. #ifdef NTSIG
  207. extern int TlsIndex;
  208. #endif /* NTSIG */
  209. int mdmtyp = n_GENERIC; /* Default modem type */
  210. int mdmset = 0; /* User explicitly set a modem type */
  211. int /* SET DIAL parameters */
  212. dialhng = 1, /* DIAL HANGUP, default is ON */
  213. dialdpy = 0, /* DIAL DISPLAY, default is OFF */
  214. mdmspd = 0, /* DIAL SPEED-MATCHING (0 = OFF) */
  215. mdmspk = 1, /* MODEM SPEAKER */
  216. mdmvol = 2, /* MODEM VOLUME */
  217. dialtmo = 0, /* DIAL TIMEOUT */
  218. dialatmo = -1, /* ANSWER TIMEOUT */
  219. dialksp = 0, /* DIAL KERMIT-SPOOF, 0 = OFF */
  220. dialidt = 0, /* DIAL IGNORE-DIALTONE */
  221. #ifndef CK_RTSCTS
  222. /* If we can't do RTS/CTS then there's no flow control at first. */
  223. /* So we might easily lose the echo to the init string and the OK */
  224. /* and then give "No response from modem" errors. */
  225. dialpace = 150, /* DIAL PACING */
  226. #else
  227. dialpace = -1,
  228. #endif /* CK_RTSCTS */
  229. /* 0 = RS232 (drop DTR); 1 = MODEM-COMMAND (e.g. <sec>+++<sec>ATH0) */
  230. dialmhu = DEFMDMHUP; /* MODEM HANGUP-METHOD */
  231. int
  232. dialec = 1, /* DIAL ERROR-CORRECTION */
  233. dialdc = 1, /* DIAL COMPRESSION */
  234. #ifdef VMS
  235. /* VMS can only use Xon/Xoff */
  236. dialfc = FLO_XONX, /* DIAL FLOW-CONTROL */
  237. #else
  238. dialfc = FLO_AUTO,
  239. #endif /* VMS */
  240. dialmth = XYDM_D, /* DIAL METHOD (Tone, Pulse, Defalt) */
  241. dialmauto = 1, /* DIAL METHOD is AUTO */
  242. dialesc = 0; /* DIAL ESCAPE */
  243. int telephony = 0; /* Command-line '-T' option */
  244. long dialmax = 0L, /* Modem's max interface speed */
  245. dialcapas = 0L; /* Modem's capabilities */
  246. int dialsta = DIA_UNK; /* Detailed return code (ckuusr.h) */
  247. #ifdef COMMENT
  248. int ans_cid = 0; /* SET ANSWER parameters */
  249. int ans_rings = 0; /* (not used yet...) */
  250. #endif /* COMMENT */
  251. int is_rockwell = 0;
  252. int is_motorola = 0;
  253. int is_supra = 0;
  254. int is_hayeshispd = 0;
  255. /* Dialing directory list */
  256. char *dialdir[MAXDDIR]; /* DIAL DIRECTORY filename array */
  257. int ndialdir = 0; /* How many dial directories */
  258. /* User overrides for built-in modem commands */
  259. char *dialini = NULL; /* MODEM INIT-STRING none */
  260. char *dialmstr = NULL; /* MODEM DIALMODE-STRING */
  261. char *dialmprmt = NULL; /* MODEM DIALMODE-PROMPT */
  262. char *dialcmd = NULL; /* MODEM DIAL-COMMAND, default none */
  263. char *dialname = NULL; /* Descriptive name for modem */
  264. char *dialdcon = NULL; /* DC ON command */
  265. char *dialdcoff = NULL; /* DC OFF command */
  266. char *dialecon = NULL; /* EC ON command */
  267. char *dialecoff = NULL; /* EC OFF command */
  268. char *dialaaon = NULL; /* Autoanswer ON command */
  269. char *dialaaoff = NULL; /* Autoanswer OFF command */
  270. char *dialhcmd = NULL; /* Hangup command */
  271. char *dialhwfc = NULL; /* Hardware flow control command */
  272. char *dialswfc = NULL; /* (Local) software f.c. command */
  273. char *dialnofc = NULL; /* No (Local) flow control command */
  274. char *dialtone = NULL; /* Command to force tone dialing */
  275. char *dialpulse = NULL; /* ..to force pulse dialing */
  276. char *dialx3 = NULL; /* Ignore dialtone */
  277. char *mdmname = NULL;
  278. char *dialspon = NULL; /* Speaker On command */
  279. char *dialspoff = NULL; /* Speaker Off command */
  280. char *dialvol1 = NULL; /* Volume Low command */
  281. char *dialvol2 = NULL; /* Volume Medium command */
  282. char *dialvol3 = NULL; /* Volume High command */
  283. char *dialini2 = NULL; /* Second init string */
  284. /* Phone number options */
  285. char *dialnpr = NULL; /* DIAL PREFIX, ditto */
  286. char *diallac = NULL; /* DIAL LOCAL-AREA-CODE, ditto */
  287. char *diallcc = NULL; /* DIAL LOCAL-COUNTRY-CODE, ditto */
  288. char *dialixp = NULL; /* DIAL INTL-PREFIX */
  289. char *dialixs = NULL; /* DIAL INTL-SUFFIX */
  290. char *dialldp = NULL; /* DIAL LD-PREFIX */
  291. char *diallds = NULL; /* DIAL LD-SUFFIX */
  292. char *diallcp = NULL; /* DIAL LOCAL-PREFIX */
  293. char *diallcs = NULL; /* DIAL LOCAL-SUFFIX */
  294. char *dialpxi = NULL; /* DIAL PBX-INTERNAL-PREFIX */
  295. char *dialpxo = NULL; /* DIAL PBX-OUTSIDE-PREFIX */
  296. char *dialsfx = NULL; /* DIAL SUFFIX */
  297. char *dialtfp = NULL; /* DIAL TOLL-FREE-PREFIX */
  298. char *callid_date = NULL; /* Caller ID strings */
  299. char *callid_time = NULL;
  300. char *callid_name = NULL;
  301. char *callid_nmbr = NULL;
  302. char *callid_mesg = NULL;
  303. extern char * d_name;
  304. extern char * dialtfc[]; /* DIAL TOLL-FREE-AREA-CODE */
  305. extern char * dialpxx[]; /* DIAL PBX-EXCHANGE */
  306. extern int ntollfree;
  307. extern int ndialpxx;
  308. extern char * dialpucc[]; /* DIAL Pulse countries */
  309. extern int ndialpucc;
  310. extern char * dialtocc[]; /* DIAL Tone countries */
  311. extern int ndialtocc;
  312. char *dialmac = NULL; /* DIAL macro */
  313. /* Countries where pulse dialing must be used (tone is not available) */
  314. static char * pulsecc[] = { NULL }; /* (Unknown at present) */
  315. /* Countries where tone dialing may safely be the default. */
  316. /* "+" marks countries where pulse is also allowed. */
  317. /* Both Pulse and Tone are allowed in Austria & Switzerland but it is not */
  318. /* yet known if Tone is universally in those countries. */
  319. static char * tonecc[] = {
  320. "1", /* + North American Numbering Plan */
  321. "31", /* Netherlands */
  322. "32", /* Belgium */
  323. "33", /* France */
  324. "352", /* Luxembourg */
  325. "353", /* Ireland */
  326. "354", /* Iceland */
  327. "358", /* Finland */
  328. "39", /* Italy */
  329. "44", /* + UK */
  330. "45", /* Denmark */
  331. "46", /* Sweden */
  332. "47", /* Norway */
  333. "49", /* + Germany */
  334. NULL
  335. };
  336. #ifndef MINIDIAL
  337. /*
  338. Telebit model codes:
  339. ATI Model Numbers Examples
  340. --- ------------- --------
  341. 123 Telebit in "total Hayes-1200" emulation mode
  342. 960 Telebit in Conventional Command (Hayes) mode
  343. 961 RA12C IBM PC internal original Trailblazer
  344. 962 RA12E External original Trailblazer
  345. 963 RM12C Rackmount original Trailblazer
  346. 964 T18PC IBM PC internal Trailblazer-Plus (TB+)
  347. 965 T18SA, T2SAA, T2SAS External TB+, T1600, T2000, T3000, WB, and later
  348. 966 T18RMM Rackmount TB+
  349. 967 T2MC IBM PS/2 internal TB+
  350. 968 T1000 External T1000
  351. 969 ? Qblazer
  352. 970 Qblazer Plus
  353. 971 T2500 External T2500
  354. 972 T2500 Rackmount T2500
  355. */
  356. /* Telebit model codes */
  357. #define TB_UNK 0 /* Unknown Telebit model */
  358. #define TB_BLAZ 1 /* Original TrailBlazer */
  359. #define TB_PLUS 2 /* TrailBlazer Plus */
  360. #define TB_1000 3 /* T1000 */
  361. #define TB_1500 4 /* T1500 */
  362. #define TB_1600 5 /* T1600 */
  363. #define TB_2000 6 /* T2000 */
  364. #define TB_2500 7 /* T2500 */
  365. #define TB_3000 8 /* T3000 */
  366. #define TB_QBLA 9 /* Qblazer */
  367. #define TB_WBLA 10 /* WorldBlazer */
  368. #define TB__MAX 10 /* Highest number */
  369. char *tb_name[] = { /* Array of model names */
  370. "Unknown", /* TB_UNK */
  371. "TrailBlazer", /* TB_BLAZ */
  372. "TrailBlazer-Plus", /* TB_PLUS */
  373. "T1000", /* TB_1000 */
  374. "T1500", /* TB_1500 */
  375. "T1600", /* TB_1600 */
  376. "T2000", /* TB_2000 */
  377. "T2500", /* TB_2500 */
  378. "T3000", /* TB_3000 */
  379. "Qblazer", /* TB_QBLA */
  380. "WorldBlazer", /* TB_WBLA */
  381. ""
  382. };
  383. #endif /* MINIDIAL */
  384. extern int flow, local, mdmtyp, quiet, backgrd, parity, seslog, network;
  385. extern int carrier, duplex, mdmsav, reliable, setreliable;
  386. extern int ttnproto, nettype;
  387. extern long speed;
  388. extern char ttname[], sesfil[];
  389. #ifndef NOXFER
  390. extern CHAR stchr;
  391. extern int interrupted;
  392. #endif /* NOXFER */
  393. /* Failure codes */
  394. #define F_TIME 1 /* timeout */
  395. #define F_INT 2 /* interrupt */
  396. #define F_MODEM 3 /* modem-detected failure */
  397. #define F_MINIT 4 /* cannot initialize modem */
  398. #ifndef CK_TAPI
  399. static
  400. #endif /* CK_TAPI */
  401. #ifdef OS2
  402. volatile
  403. #endif /* OS2 */
  404. int fail_code = 0; /* Default failure reason. */
  405. static int xredial = 0;
  406. static int func_code; /* 0 = dialing, nonzero = answering */
  407. static int partial;
  408. static int mymdmtyp = 0;
  409. #define DW_NOTHING 0 /* What we are doing */
  410. #define DW_INIT 1
  411. #define DW_DIAL 2
  412. static int dial_what = DW_NOTHING; /* Nothing at first. */
  413. static int nonverbal = 0; /* Hayes in numeric response mode */
  414. static MDMINF * mp;
  415. static CHAR escbuf[6];
  416. static long mdmcapas;
  417. _PROTOTYP (static VOID dreset, (void) );
  418. _PROTOTYP (static int (*xx_ok), (int,int) );
  419. _PROTOTYP (static int ddinc, (int) );
  420. _PROTOTYP (int dialhup, (void) );
  421. _PROTOTYP (int getok, (int,int) );
  422. _PROTOTYP (char * ck_time, (void) );
  423. _PROTOTYP (static VOID ttslow, (char *, int) );
  424. #ifdef COMMENT
  425. _PROTOTYP (static VOID xcpy, (char *, char *, unsigned int) );
  426. #endif /* COMMENT */
  427. _PROTOTYP (static VOID waitfor, (char *) );
  428. _PROTOTYP (static VOID dialoc, (char) );
  429. _PROTOTYP (static int didweget, (char *, char *) );
  430. _PROTOTYP (static VOID spdchg, (long) );
  431. _PROTOTYP (static int dialfail, (int) );
  432. _PROTOTYP (static VOID gethrw, (void) );
  433. _PROTOTYP (static VOID gethrn, (void) );
  434. int dialudt = n_UDEF; /* Number of user-defined type */
  435. /* BEGIN MDMINF STRUCT DEFINITIONS */
  436. /*
  437. Declare structures containing modem-specific information.
  438. REMEMBER that only the first SEVEN characters of these names are
  439. guaranteed to be unique.
  440. First declare the three types that are allowed for MINIDIAL versions.
  441. */
  442. static
  443. MDMINF CCITT = /* CCITT / ITU-T V.25bis autodialer */
  444. /*
  445. According to V.25bis:
  446. . Even parity is required for giving commands to the modem.
  447. . Commands might or might not echo.
  448. . Responses ("Indications") from the modem are terminated by CR and LF.
  449. . Call setup is accomplished by:
  450. - DTE raises DTR (V.24 circuit 108) [ttopen() does this]
  451. - Modem raises CTS (V.24 circuit 106) [C-Kermit ignores this]
  452. - DTE issues a call request command ("CRN")
  453. - Modem responds with "VAL" ("command accepted")
  454. - If the call is completed:
  455. modem responds with "CNX" ("call connected");
  456. modem turns CTS (106) OFF;
  457. modem turns DSR (107) ON;
  458. else:
  459. modem responds with "CFI <parameter>" ("call failure indication").
  460. . To clear a call, the DTE turns DTR (108) OFF.
  461. . There is no mention of the Carrier Detect circuit (109) in the standard.
  462. . There is no provision for "escaping back" to the modem's command mode.
  463. It is not known whether there exists in real life a pure V.25bis modem.
  464. If there is, this code has never been tested on it. See the Digitel entry.
  465. */
  466. {
  467. "Any CCITT / ITU-T V.25bis conformant modem",
  468. "", /* pulse command */
  469. "", /* tone command */
  470. 40, /* dial_time -- programmable -- */
  471. ",:", /* pause_chars -- "," waits for programmable time */
  472. /* ":" waits for dial tone */
  473. 10, /* pause_time (seconds, just a guess) */
  474. "", /* wake_str (none) */
  475. 200, /* wake_rate (msec) */
  476. "VAL", /* wake_prompt */
  477. "", /* dmode_str (none) */
  478. "", /* dmode_prompt (none) */
  479. "CRN%s\015", /* dial_str */
  480. 200, /* dial_rate (msec) */
  481. 0, /* No esc_time */
  482. 0, /* No esc_char */
  483. "", /* No hup_str */
  484. "", /* hwfc_str */
  485. "", /* swfc_str */
  486. "", /* nofc_str */
  487. "", /* ec_on_str */
  488. "", /* ec_off_str */
  489. "", /* dc_on_str */
  490. "", /* dc_off_str */
  491. "CIC\015", /* aa_on_str */
  492. "DIC\015", /* aa_off_str */
  493. "", /* sb_on_str */
  494. "", /* sb_off_str */
  495. "", /* sp_off_str */
  496. "", /* sp_on_str */
  497. "", /* vol1_str */
  498. "", /* vol2_str */
  499. "", /* vol3_str */
  500. "", /* ignoredt */
  501. "", /* ini2 */
  502. 0L, /* max_speed */
  503. CKD_V25, /* capas */
  504. NULL /* No ok_fn */
  505. };
  506. static
  507. MDMINF HAYES = /* Hayes 2400 and compatible modems */
  508. {
  509. "Hayes Smartmodem 2400 and compatibles",
  510. "ATP\015", /* pulse command */
  511. "ATT\015", /* tone command */
  512. 35, /* dial_time */
  513. ",", /* pause_chars */
  514. 2, /* pause_time */
  515. #ifdef OS2
  516. "ATE1Q0V1&S0&C1&D2\015", /* wake_str */
  517. #else
  518. #ifdef VMS
  519. "ATQ0&S1\015", /* wake_str */
  520. #else
  521. "ATQ0\015", /* wake_str */
  522. #endif /* VMS */
  523. #endif /* OS2 */
  524. 0, /* wake_rate */
  525. "OK\015", /* wake_prompt */
  526. "", /* dmode_str */
  527. "", /* dmode_prompt */
  528. "ATD%s\015", /* dial_str, user supplies D or T */
  529. 0, /* dial_rate */
  530. 1100, /* esc_time */
  531. 43, /* esc_char */
  532. "ATQ0H0\015", /* hup_str */
  533. "", /* hwfc_str */
  534. "", /* swfc_str */
  535. "", /* nofc_str */
  536. "", /* ec_on_str */
  537. "", /* ec_off_str */
  538. "", /* dc_on_str */
  539. "", /* dc_off_str */
  540. "ATS0=1\015", /* aa_on_str */
  541. "ATS0=0\015", /* aa_off_str */
  542. "", /* sb_on_str */
  543. "", /* sb_off_str */
  544. "ATM1\015", /* sp_on_str */
  545. "ATM0\015", /* sp_off_str */
  546. "ATL1\015", /* vol1_str */
  547. "ATL2\015", /* vol2_str */
  548. "ATL3\015", /* vol3_str */
  549. "ATX3\015", /* ignoredt */
  550. "", /* ini2 */
  551. 2400L, /* max_speed */
  552. CKD_AT, /* capas */
  553. getok /* ok_fn */
  554. };
  555. /*
  556. The intent of the "unknown" modem is to allow KERMIT to support
  557. unknown modems by having the user type the entire autodial sequence
  558. (possibly including control characters, etc.) as the "phone number".
  559. The protocol and other characteristics of this modem are unknown, with
  560. some "reasonable" values being chosen for some of them. The only way to
  561. detect if a connection is made is to look for carrier.
  562. */
  563. static
  564. MDMINF UNKNOWN = /* Information for "Unknown" modem */
  565. {
  566. "Unknown", /* name */
  567. "", /* pulse command */
  568. "", /* tone command */
  569. 30, /* dial_time */
  570. "", /* pause_chars */
  571. 0, /* pause_time */
  572. "", /* wake_str */
  573. 0, /* wake_rate */
  574. "", /* wake_prompt */
  575. "", /* dmode_str */
  576. NULL, /* dmode_prompt */
  577. "%s\015", /* dial_str */
  578. 0, /* dial_rate */
  579. 0, /* esc_time */
  580. 0, /* esc_char */
  581. "", /* hup_str */
  582. "", /* hwfc_str */
  583. "", /* swfc_str */
  584. "", /* nofc_str */
  585. "", /* ec_on_str */
  586. "", /* ec_off_str */
  587. "", /* dc_on_str */
  588. "", /* dc_off_str */
  589. "", /* aa_on_str */
  590. "", /* aa_off_str */
  591. "", /* sb_on_str */
  592. "", /* sb_off_str */
  593. "", /* sp_off_str */
  594. "", /* sp_on_str */
  595. "", /* vol1_str */
  596. "", /* vol2_str */
  597. "", /* vol3_str */
  598. "", /* ignoredt */
  599. "", /* ini2 */
  600. 0L, /* max_speed */
  601. 0, /* capas */
  602. NULL /* ok_fn */
  603. };
  604. #ifndef MINIDIAL
  605. static
  606. MDMINF ATTISN = /* AT&T ISN Network */
  607. {
  608. "", /* pulse command */
  609. "", /* tone command */
  610. "AT&T ISN Network",
  611. 30, /* Dial time */
  612. "", /* Pause characters */
  613. 0, /* Pause time */
  614. "\015\015\015\015", /* Wake string */
  615. 900, /* Wake rate */
  616. "DIAL", /* Wake prompt */
  617. "", /* dmode_str */
  618. "", /* dmode_prompt */
  619. "%s\015", /* dial_str */
  620. 0, /* dial_rate */
  621. 0, /* esc_time */
  622. 0, /* esc_char */
  623. "", /* hup_str */
  624. "", /* hwfc_str */
  625. "", /* swfc_str */
  626. "", /* nofc_str */
  627. "", /* ec_on_str */
  628. "", /* ec_off_str */
  629. "", /* dc_on_str */
  630. "", /* dc_off_str */
  631. "", /* aa_on_str */
  632. "", /* aa_off_str */
  633. "", /* sb_on_str */
  634. "", /* sb_off_str */
  635. "", /* sp_off_str */
  636. "", /* sp_on_str */
  637. "", /* vol1_str */
  638. "", /* vol2_str */
  639. "", /* vol3_str */
  640. "", /* ignoredt */
  641. "", /* ini2 */
  642. 0L, /* max_speed */
  643. 0, /* capas */
  644. NULL /* ok_fn */
  645. };
  646. static
  647. MDMINF ATTMODEM = /* information for AT&T switched-network modems */
  648. /* "Number" following "dial" can include: p's and
  649. * t's to indicate pulse or tone (default) dialing,
  650. * + for wait for dial tone, , for pause, r for
  651. * last number dialed, and, except for 2224B, some
  652. * comma-delimited options like o12=y, before number.
  653. * "Important" options for the modems:
  654. *
  655. * All: Except for 2224B, enable option 12 for "transparent
  656. * data," o12=y. If a computer port used for both
  657. * incoming and outgoing calls is connected to the
  658. * modem, disable "enter interactive mode on carriage
  659. * return," EICR. The Kermit "dial" command can
  660. * function with EIA leads standard, EIAS.
  661. *
  662. * 2212C: Internal hardware switches at their default
  663. * positions (four rockers down away from numbers)
  664. * unless EICR is not wanted (rocker down at the 4).
  665. * For EIAS, rocker down at the 1.
  666. *
  667. * 2224B: Front-panel switch position 1 must be up (at the 1,
  668. * closed). Disable EICR with position 2 down.
  669. * For EIAS, position 4 down.
  670. * All switches on the back panel down.
  671. *
  672. * 2224CEO: All front-panel switches down except either 5 or 6.
  673. * Enable interactive flow control with o16=y.
  674. * Select normal asynchronous mode with o34=0 (zero).
  675. * Disable EICR with position 3 up. For EIAS, 1 up.
  676. * Reset the modem after changing switches.
  677. *
  678. * 2296A: If option 00 (zeros) is present, use o00=0.
  679. * Enable interactive flow control with o16=y.
  680. * Select normal asynchronous mode with o34=0 (zero).
  681. * (available in Microcom Networking version, but
  682. * not necessarily other models of the 2296A).
  683. * Enable modem-port flow control (if available) with
  684. * o42=y. Enable asynchronous operation with o50=y.
  685. * Disable EICR with o69=n. For EIAS, o66=n, using
  686. * front panel.
  687. */
  688. {
  689. "AT&T switched-network modems",
  690. "", /* pulse command */
  691. "", /* tone command */
  692. 20, /* dial_time */
  693. ",", /* pause_chars */
  694. 2, /* pause_time */
  695. "+", /* wake_str */
  696. 0, /* wake_rate */
  697. "", /* wake_prompt */
  698. "", /* dmode_str */
  699. "", /* dmode_prompt */
  700. "at%s\015", /* dial_str */
  701. 0, /* dial_rate */
  702. 0, /* esc_time */
  703. 0, /* esc_char */
  704. "", /* hup_str */
  705. "", /* hwfc_str */
  706. "", /* swfc_str */
  707. "", /* nofc_str */
  708. "", /* ec_on_str */
  709. "", /* ec_off_str */
  710. "", /* dc_on_str */
  711. "", /* dc_off_str */
  712. "", /* aa_on_str */
  713. "", /* aa_off_str */
  714. "", /* sb_on_str */
  715. "", /* sb_off_str */
  716. "", /* sp_off_str */
  717. "", /* sp_on_str */
  718. "", /* vol1_str */
  719. "", /* vol2_str */
  720. "", /* vol3_str */
  721. "", /* ignoredt */
  722. "", /* ini2 */
  723. 0L, /* max_speed */
  724. CKD_AT, /* capas */
  725. NULL /* ok_fn */
  726. };
  727. static
  728. MDMINF ATTDTDM = /* AT&T Digital Terminal Data Module */
  729. /* For dialing: KYBD switch down, others usually up. */
  730. {
  731. "AT&T Digital Terminal Data Module",
  732. "", /* pulse command */
  733. "", /* tone command */
  734. 20, /* dial_time */
  735. "", /* pause_chars */
  736. 0, /* pause_time */
  737. "", /* wake_str */
  738. 0, /* wake_rate */
  739. "", /* wake_prompt */
  740. "", /* dmode_str */
  741. "", /* dmode_prompt */
  742. "%s\015", /* dial_str */
  743. 0, /* dial_rate */
  744. 0, /* esc_time */
  745. 0, /* esc_char */
  746. "", /* hup_str */
  747. "", /* hwfc_str */
  748. "", /* swfc_str */
  749. "", /* nofc_str */
  750. "", /* ec_on_str */
  751. "", /* ec_off_str */
  752. "", /* dc_on_str */
  753. "", /* dc_off_str */
  754. "", /* aa_on_str */
  755. "", /* aa_off_str */
  756. "", /* sb_on_str */
  757. "", /* sb_off_str */
  758. "", /* sp_off_str */
  759. "", /* sp_on_str */
  760. "", /* vol1_str */
  761. "", /* vol2_str */
  762. "", /* vol3_str */
  763. "", /* ignoredt */
  764. "", /* ini2 */
  765. 0L, /* max_speed */
  766. 0, /* capas */
  767. NULL /* ok_fn */
  768. };
  769. static
  770. MDMINF DIGITEL = /* Digitel DT-22 CCITT variant used in Brazil */
  771. /*
  772. Attempts to adhere strictly to the V.25bis specification do not produce good
  773. results in real life. The modem for which this code was developed: (a)
  774. ignores parity; (b) sometimes terminates responses with LF CR instead of CR
  775. LF; (c) has a Hayes-like escape sequence; (d) supports a hangup ("HUP")
  776. command. Information from Fernando Cabral in Brasilia.
  777. */
  778. {
  779. "Digitel DT-22 CCITT dialer",
  780. "", /* pulse command */
  781. "", /* tone command */
  782. 40, /* dial_time -- programmable -- */
  783. ",:", /* pause_chars -- "," waits for programmable time */
  784. /* ":" waits for dial tone */
  785. 10, /* pause_time (seconds, just a guess) */
  786. "HUP\015", /* wake_str (Not Standard CCITT) */
  787. 200, /* wake_rate (msec) */
  788. "VAL", /* wake_prompt */
  789. "", /* dmode_str (none) */
  790. "", /* dmode_prompt (none) */
  791. "CRN%s\015", /* dial_str */
  792. 200, /* dial_rate (msec) */
  793. 1100, /* esc_time (Not Standard CCITT) */
  794. 43, /* esc_char (Not Standard CCITT) */
  795. "HUP\015", /* hup_str (Not Standard CCITT) */
  796. "", /* hwfc_str */
  797. "", /* swfc_str */
  798. "", /* nofc_str */
  799. "", /* ec_on_str */
  800. "", /* ec_off_str */
  801. "", /* dc_on_str */
  802. "", /* dc_off_str */
  803. "CIC\015", /* aa_on_str */
  804. "DIC\015", /* aa_off_str */
  805. "", /* sb_on_str */
  806. "", /* sb_off_str */
  807. "", /* sp_off_str */
  808. "", /* sp_on_str */
  809. "", /* vol1_str */
  810. "", /* vol2_str */
  811. "", /* vol3_str */
  812. "", /* ignoredt */
  813. "", /* ini2 */
  814. 0L, /* max_speed */
  815. CKD_V25, /* capas */
  816. getok /* ok_fn */
  817. };
  818. static
  819. MDMINF H_1200 = /* Hayes 1200 and compatible modems */
  820. {
  821. "Hayes Smartmodem 1200 and compatibles",
  822. "ATP\015", /* pulse command */
  823. "ATT\015", /* tone command */
  824. 35, /* dial_time */
  825. ",", /* pause_chars */
  826. 2, /* pause_time */
  827. #ifdef OS2
  828. "ATE1Q0V1\015", /* wake_str */
  829. #else
  830. "ATQ0\015", /* wake_str */
  831. #endif /* OS2 */
  832. 0, /* wake_rate */
  833. "OK\015", /* wake_prompt */
  834. "", /* dmode_str */
  835. "", /* dmode_prompt */
  836. "ATD%s\015", /* dial_str */
  837. 0, /* dial_rate */
  838. 1100, /* esc_time */
  839. 43, /* esc_char */
  840. "ATQ0H0\015", /* hup_str */
  841. "", /* hwfc_str */
  842. "", /* swfc_str */
  843. "", /* nofc_str */
  844. "", /* ec_on_str */
  845. "", /* ec_off_str */
  846. "", /* dc_on_str */
  847. "", /* dc_off_str */
  848. "ATS0=1\015", /* aa_on_str */
  849. "ATS0=0\015", /* aa_off_str */
  850. "", /* sb_on_str */
  851. "", /* sb_off_str */
  852. "ATM1\015", /* sp_on_str */
  853. "ATM0\015", /* sp_off_str */
  854. "ATL1\015", /* vol1_str */
  855. "ATL2\015", /* vol2_str */
  856. "ATL3\015", /* vol3_str */
  857. "", /* ignoredt */
  858. "", /* ini2 */
  859. 1200L, /* max_speed */
  860. CKD_AT, /* capas */
  861. getok /* ok_fn */
  862. };
  863. static
  864. MDMINF H_ULTRA = /* Hayes high-speed */
  865. {
  866. "Hayes Ultra/Optima/Accura 96/144/288", /* U,O,A */
  867. "ATP\015", /* pulse command */
  868. "ATT\015", /* tone command */
  869. 35, /* dial_time */
  870. ",", /* pause_chars */
  871. 2, /* pause_time */
  872. #ifdef OS2
  873. "ATE1Q0V1X4N1Y0&S0&C1&D2S37=0S82=128\015", /* wake_str */
  874. #else
  875. #ifdef VMS
  876. "ATQ0X4N1Y0&S1S37=0S82=128\015", /* wake_str */
  877. #else
  878. "ATQ0X4N1Y0S37=0S82=128\015", /* wake_str */
  879. #endif /* VMS */
  880. #endif /* OS2 */
  881. 0, /* wake_rate */
  882. "OK\015", /* wake_prompt */
  883. "", /* dmode_str */
  884. "", /* dmode_prompt */
  885. "ATD%s\015", /* dial_str */
  886. 0, /* dial_rate */
  887. 1100, /* esc_time */
  888. 43, /* esc_char */
  889. "ATQ0H0\015", /* hup_str */
  890. "AT&K3\015", /* hwfc_str */ /* OK for U,O */
  891. "AT&K4\015", /* swfc_str */ /* OK for U,O */
  892. "AT&K0\015", /* nofc_str */ /* OK for U,O */
  893. "AT&Q5S36=7S48=7\015", /* ec_on_str */ /* OK for U,O */
  894. "AT&Q0\015", /* ec_off_str */ /* OK for U,O */
  895. "ATS46=2\015", /* dc_on_str */
  896. "ATS46=0\015", /* dc_off_str */
  897. "ATS0=1\015", /* aa_on_str */
  898. "ATS0=0\015", /* aa_off_str */
  899. "", /* sb_on_str */
  900. "", /* sb_off_str */
  901. "ATM1\015", /* sp_on_str */
  902. "ATM0\015", /* sp_off_str */
  903. "ATL1\015", /* vol1_str */
  904. "ATL2\015", /* vol2_str */
  905. "ATL3\015", /* vol3_str */
  906. "ATX3\015", /* ignoredt */
  907. "", /* ini2 */
  908. 115200L, /* max_speed */ /* (varies) */
  909. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  910. getok /* ok_fn */
  911. };
  912. static
  913. MDMINF H_ACCURA = /* Hayes Accura */
  914. { /* GUESSING IT'S LIKE ULTRA & OPTIMA */
  915. "Hayes Accura",
  916. "ATP\015", /* pulse command */
  917. "ATT\015", /* tone command */
  918. 35, /* dial_time */
  919. ",", /* pause_chars */
  920. 2, /* pause_time */
  921. #ifdef OS2
  922. "ATE1Q0V1X4N1Y0&S0&C1&D2S37=0\015", /* wake_str */
  923. #else
  924. #ifdef VMS
  925. "ATQ0X4N1Y0&S1S37=0\015", /* wake_str */
  926. #else
  927. "ATQ0X4N1Y0S37=0\015", /* wake_str */
  928. #endif /* VMS */
  929. #endif /* OS2 */
  930. 0, /* wake_rate */
  931. "OK\015", /* wake_prompt */
  932. "", /* dmode_str */
  933. "", /* dmode_prompt */
  934. "ATD%s\015", /* dial_str */
  935. 0, /* dial_rate */
  936. 1100, /* esc_time */
  937. 43, /* esc_char */
  938. "ATQ0H0\015", /* hup_str */
  939. "AT&K3\015", /* hwfc_str */
  940. "AT&K4\015", /* swfc_str */
  941. "AT&K0\015", /* nofc_str */
  942. "AT&Q5S36=7S48=7\015", /* ec_on_str */
  943. "AT&Q0\015", /* ec_off_str */
  944. "ATS46=2\015", /* dc_on_str */
  945. "ATS46=0\015", /* dc_off_str */
  946. "ATS0=1\015", /* aa_on_str */
  947. "ATS0=0\015", /* aa_off_str */
  948. "", /* sb_on_str */
  949. "", /* sb_off_str */
  950. "ATM1\015", /* sp_on_str */
  951. "ATM0\015", /* sp_off_str */
  952. "ATL1\015", /* vol1_str */
  953. "ATL2\015", /* vol2_str */
  954. "ATL3\015", /* vol3_str */
  955. "ATX3\015", /* ignoredt */
  956. "", /* ini2 */
  957. 115200L, /* max_speed */ /* (varies) */
  958. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  959. getok /* ok_fn */
  960. };
  961. static
  962. MDMINF PPI = /* Practical Peripherals */
  963. {
  964. "Practical Peripherals V.22bis or higher with V.42 and V.42bis",
  965. "ATP\015", /* pulse command */
  966. "ATT\015", /* tone command */
  967. 35, /* dial_time */
  968. ",", /* pause_chars */
  969. 2, /* pause_time */
  970. #ifdef COMMENT
  971. /* In newer models S82 (BREAK handling) was eliminated, causing an error. */
  972. #ifdef OS2
  973. "ATQ0X4N1&S0&C1&D2S37=0S82=128\015", /* wake_str */
  974. #else
  975. "ATQ0X4N1S37=0S82=128\015", /* wake_str */
  976. #endif /* OS2 */
  977. #else /* So now we use Y0 instead */
  978. #ifdef OS2
  979. "ATE1Q0V1X4N1&S0&C1&D2Y0S37=0\015", /* wake_str */
  980. #else
  981. #ifdef VMS
  982. "ATQ0X4N1Y0&S1S37=0\015", /* wake_str */
  983. #else
  984. "ATQ0X4N1Y0S37=0\015", /* wake_str */
  985. #endif /* VMS */
  986. #endif /* OS2 */
  987. #endif /* COMMENT */
  988. 0, /* wake_rate */
  989. "OK\015", /* wake_prompt */
  990. "", /* dmode_str */
  991. "", /* dmode_prompt */
  992. "ATD%s\015", /* dial_str */
  993. 0, /* dial_rate */
  994. 1100, /* esc_time */
  995. 43, /* esc_char */
  996. "ATQ0H0\015", /* hup_str */
  997. "AT&K3\015", /* hwfc_str */
  998. "AT&K4\015", /* swfc_str */
  999. "AT&K0\015", /* nofc_str */
  1000. "AT&Q5S36=7S48=7\015", /* ec_on_str */
  1001. "AT&Q0S36=0S48=128\015", /* ec_off_str */
  1002. "ATS46=2\015", /* dc_on_str */
  1003. "ATS46=0\015", /* dc_off_str */
  1004. "ATS0=1\015", /* aa_on_str */
  1005. "ATS0=0\015", /* aa_off_str */
  1006. "", /* sb_on_str */
  1007. "", /* sb_off_str */
  1008. "ATM1\015", /* sp_on_str */
  1009. "ATM0\015", /* sp_off_str */
  1010. "ATL1\015", /* vol1_str */
  1011. "ATL2\015", /* vol2_str */
  1012. "ATL3\015", /* vol3_str */
  1013. "ATX3\015", /* ignoredt */
  1014. "", /* ini2 */
  1015. 115200L, /* max_speed */
  1016. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1017. getok /* ok_fn */
  1018. };
  1019. static
  1020. MDMINF DATAPORT = /* AT&T Dataport */
  1021. {
  1022. "AT&T / Paradyne DataPort V.32 or higher",
  1023. "ATP\015", /* pulse command */
  1024. "ATT\015", /* tone command */
  1025. 35, /* dial_time */
  1026. ",", /* pause_chars */
  1027. 2, /* pause_time */
  1028. /*
  1029. Note: S41=0 (use highest modulation) omitted, since it is not
  1030. supported on the V.32 and lower models. So let's not touch it.
  1031. */
  1032. #ifdef OS2
  1033. "ATQ0E1V1X6&S0&C1&D2&Q0Y0\\K5S78=0\015", /* wake_str */
  1034. #else
  1035. #ifdef VMS
  1036. "ATQ0E1X6&S1&Q0Y0\\K5S78=0\015", /* wake_str */
  1037. #else
  1038. "ATQ0E1X6&Q0Y0\\K5S78=0\015", /* wake_str */
  1039. #endif /* VMS */
  1040. #endif /* OS2 */
  1041. 0, /* wake_rate */
  1042. "OK\015", /* wake_prompt */
  1043. "", /* dmode_str */
  1044. "", /* dmode_prompt */
  1045. "ATD%s\015", /* dial_str */
  1046. 0, /* dial_rate */
  1047. 1100, /* esc_time */
  1048. 43, /* esc_char */
  1049. "ATQ0H0\015", /* hup_str */
  1050. "AT\\Q3\015", /* hwfc_str */
  1051. "AT\\Q1\\X0\015", /* swfc_str */
  1052. "AT\\Q0\015", /* nofc_str */
  1053. "AT\\N7\015", /* ec_on_str */
  1054. "AT\\N0\015", /* ec_off_str */
  1055. "AT%C1\015", /* dc_on_str */
  1056. "AT%C0\015", /* dc_off_str */
  1057. "ATS0=1\015", /* aa_on_str */
  1058. "ATS0=0\015", /* aa_off_str */
  1059. "", /* sb_on_str */
  1060. "", /* sb_off_str */
  1061. "ATM1\015", /* sp_on_str */
  1062. "ATM0\015", /* sp_off_str */
  1063. "ATL1\015", /* vol1_str */
  1064. "ATL2\015", /* vol2_str */
  1065. "ATL3\015", /* vol3_str */
  1066. "ATX3\015", /* ignoredt */
  1067. "", /* ini2 */
  1068. 57600L, /* max_speed */
  1069. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1070. getok /* ok_fn */
  1071. };
  1072. static
  1073. MDMINF UCOM_AT = /* Microcom DeskPorte FAST ES 28.8 */
  1074. {
  1075. "Microcom DeskPorte FAST 28.8",
  1076. "ATP\015", /* pulse command */
  1077. "ATT\015", /* tone command */
  1078. 35, /* dial_time */
  1079. ",", /* pause_chars */
  1080. 2, /* pause_time */
  1081. #ifdef OS2
  1082. "ATE1Q0V1X4\\N0F0&S0&C1&D2\\K5\015", /* wake_str */
  1083. #else
  1084. #ifdef VMS
  1085. "ATQ0X4F0&S1\\K5\015", /* wake_str */
  1086. #else
  1087. "ATQ0X4F0\\K5\015", /* wake_str */
  1088. #endif /* VMS */
  1089. #endif /* OS2 */
  1090. 0, /* wake_rate */
  1091. "OK\015", /* wake_prompt */
  1092. "", /* dmode_str */
  1093. "", /* dmode_prompt */
  1094. "ATD%s\015", /* dial_str */
  1095. 0, /* dial_rate */
  1096. 1100, /* esc_time */
  1097. 43, /* esc_char */
  1098. "ATQ0H0\015", /* hup_str */
  1099. "AT\\Q3\015", /* hwfc_str */
  1100. "AT\\Q1\015", /* swfc_str */
  1101. "AT\\H0\\Q0\015", /* nofc_str */
  1102. "AT\\N3\015", /* ec_on_str */
  1103. "AT\\N0\015", /* ec_off_str */
  1104. "AT%C3\015", /* dc_on_str */
  1105. "AT%C0\015", /* dc_off_str */
  1106. "ATS0=1\015", /* aa_on_str */
  1107. "ATS0=0\015", /* aa_off_str */
  1108. "AT-J0\015", /* sb_on_str */
  1109. "AT-J1\015", /* sb_off_str */
  1110. "ATM1\015", /* sp_on_str */
  1111. "ATM0\015", /* sp_off_str */
  1112. "ATL1\015", /* vol1_str */
  1113. "ATL2\015", /* vol2_str */
  1114. "ATL3\015", /* vol3_str */
  1115. "ATX3\015", /* ignoredt */
  1116. "", /* ini2 */
  1117. 115200L, /* max_speed */
  1118. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1119. getok /* ok_fn */
  1120. };
  1121. static
  1122. MDMINF ZOOM = /* Zoom Telephonics V.32bis */
  1123. {
  1124. "Zoom Telephonics V.32bis",
  1125. "ATP\015", /* pulse command */
  1126. "ATT\015", /* tone command */
  1127. 35, /* dial_time */
  1128. ",", /* pause_chars */
  1129. 2, /* pause_time */
  1130. #ifdef OS2
  1131. "ATE1Q0V1N1W1X4&S0&C1&D2S82=128S95=47\015", /* wake_str */
  1132. #else
  1133. #ifdef VMS
  1134. "ATQ0E1N1W1X4&S1S82=128S95=47\015", /* wake_str */
  1135. #else
  1136. "ATQ0E1N1W1X4S82=128S95=47\015", /* wake_str */
  1137. #endif /* VMS */
  1138. #endif /* OS2 */
  1139. 0, /* wake_rate */
  1140. "OK\015", /* wake_prompt */
  1141. "", /* dmode_str */
  1142. "", /* dmode_prompt */
  1143. "ATD%s\015", /* dial_str */
  1144. 0, /* dial_rate */
  1145. 1100, /* esc_time */
  1146. 43, /* esc_char */
  1147. "ATQ0H0\015", /* hup_str */
  1148. "AT&K3\015", /* hwfc_str */
  1149. "AT&K4\015", /* swfc_str */
  1150. "AT&K0\015", /* nofc_str */
  1151. "AT&Q5S36=7S48=7\015", /* ec_on_str */
  1152. "AT&Q0\015", /* ec_off_str */
  1153. "ATS46=138\015", /* dc_on_str */
  1154. "ATS46=136\015", /* dc_off_str */
  1155. "ATS0=1\015", /* aa_on_str */
  1156. "ATS0=0\015", /* aa_off_str */
  1157. "", /* sb_on_str */
  1158. "", /* sb_off_str */
  1159. "ATM1\015", /* sp_on_str */
  1160. "ATM0\015", /* sp_off_str */
  1161. "ATL1\015", /* vol1_str */
  1162. "ATL2\015", /* vol2_str */
  1163. "ATL3\015", /* vol3_str */
  1164. "ATX3\015", /* ignoredt */
  1165. "", /* ini2 */
  1166. 57600L, /* max_speed */
  1167. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1168. getok /* ok_fn */
  1169. };
  1170. static
  1171. MDMINF ZYXEL = /* ZyXEL U-Series */
  1172. {
  1173. "ZyXEL U-Series V.32bis or higher",
  1174. "ATP\015", /* pulse command */
  1175. "ATT\015", /* tone command */
  1176. 35, /* dial_time */
  1177. ",", /* pause_chars */
  1178. 2, /* pause_time */
  1179. #ifdef OS2
  1180. "ATE1Q0V1&S0&C1&D2&N0X5&Y1\015", /* wake_str */
  1181. #else
  1182. #ifdef VMS
  1183. "ATQ0E1&S1&N0X5&Y1\015", /* wake_str */
  1184. #else
  1185. "ATQ0E1&N0X5&Y1\015", /* wake_str */
  1186. #endif /* VMS */
  1187. #endif /* OS2 */
  1188. 0, /* wake_rate */
  1189. "OK\015", /* wake_prompt */
  1190. "", /* dmode_str */
  1191. "", /* dmode_prompt */
  1192. "ATD%s\015", /* dial_str */
  1193. 0, /* dial_rate */
  1194. 1100, /* esc_time */
  1195. 43, /* esc_char */
  1196. "ATQ0H0\015", /* hup_str */
  1197. "AT&H3\015", /* hwfc_str */
  1198. "AT&H4\015", /* swfc_str */
  1199. "AT&H0\015", /* nofc_str */
  1200. "AT&K3\015", /* ec_on_str */
  1201. "AT&K0\015", /* ec_off_str */
  1202. "AT&K4\015", /* dc_on_str */
  1203. "AT&K3\015", /* dc_off_str */
  1204. "ATS0=1\015", /* aa_on_str */
  1205. "ATS0=0\015", /* aa_off_str */
  1206. "", /* sb_on_str */
  1207. "", /* sb_off_str */
  1208. "ATM1\015", /* sp_on_str */
  1209. "ATM0\015", /* sp_off_str */
  1210. "ATL1\015", /* vol1_str */
  1211. "ATL2\015", /* vol2_str */
  1212. "ATL3\015", /* vol3_str */
  1213. "ATX3\015", /* ignoredt */
  1214. "", /* ini2 */
  1215. 57600L, /* max_speed */
  1216. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1217. getok /* ok_fn */
  1218. };
  1219. static
  1220. MDMINF ZOLTRIX = /* Zoltrix */
  1221. {
  1222. "Zoltrix V.32bis and V.34 modems with Rockwell ACI chipset",
  1223. "ATP\015", /* pulse command */
  1224. "ATT\015", /* tone command */
  1225. 35, /* dial_time */
  1226. ",", /* pause_chars */
  1227. 2, /* pause_time */
  1228. #ifdef OS2
  1229. "ATE1Q0V1F0W1X4Y0&S0&C1&D2\\K5S82=128S95=41\015", /* wake_str */
  1230. #else
  1231. #ifdef VMS
  1232. "ATQ0E1F0W1X4Y0&S1\\K5S82=128S95=41\015", /* wake_str */
  1233. #else
  1234. "ATQ0E1F0W1X4Y0\\K5S82=128S95=41\015", /* wake_str */
  1235. #endif /* VMS */
  1236. #endif /* OS2 */
  1237. 0, /* wake_rate */
  1238. "OK\015", /* wake_prompt */
  1239. "", /* dmode_str */
  1240. "", /* dmode_prompt */
  1241. "ATD%s\015", /* dial_str */
  1242. 0, /* dial_rate */
  1243. 1100, /* esc_time */
  1244. 43, /* esc_char */
  1245. "ATQ0H0\015", /* hup_str */
  1246. "AT&K3\015", /* hwfc_str */
  1247. "AT&K4S32=17S33=19\015", /* swfc_str */
  1248. "AT&K0\015", /* nofc_str */
  1249. "AT\\N3\015", /* ec_on_str */
  1250. "AT\\N1\015", /* ec_off_str */
  1251. "ATS46=138%C3\015", /* dc_on_str */
  1252. "ATS46=136%C0\015", /* dc_off_str */
  1253. "ATS0=1\015", /* aa_on_str */
  1254. "ATS0=0\015", /* aa_off_str */
  1255. "AT\\N0\015", /* sb_on_str */
  1256. "AT&Q0\015", /* sb_off_str */
  1257. "ATM1\015", /* sp_on_str */
  1258. "ATM0\015", /* sp_off_str */
  1259. "ATL1\015", /* vol1_str */
  1260. "ATL2\015", /* vol2_str */
  1261. "ATL3\015", /* vol3_str */
  1262. "ATX3\015", /* ignoredt */
  1263. "", /* ini2 */
  1264. 57600L, /* max_speed */
  1265. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1266. getok /* ok_fn */
  1267. };
  1268. static
  1269. MDMINF MOTOROLA = { /* Motorola FasTalk II or Lifestyle */
  1270. /*
  1271. "\E" and "\X" commands removed - Motorola Lifestyle doesn't have them.
  1272. \E0 = Don't echo while online
  1273. \X0 = Process Xon/Xoff but don't pass through
  1274. */
  1275. "Motorola FasTalk II or Lifestyle", /* Name */
  1276. "ATP\015", /* pulse command */
  1277. "ATT\015", /* tone command */
  1278. 35, /* dial_time */
  1279. ",", /* pause_chars */
  1280. 2, /* pause_time */
  1281. #ifdef OS2
  1282. "ATE1Q0V1X4&S0&C1&D2\\K5\\V1\015", /* wake_str */
  1283. #else
  1284. #ifdef VMS
  1285. "ATQ0E1X4&S1\\K5\\V1\015", /* wake_str */
  1286. #else
  1287. "ATQ0E1X4\\K5\\V1\015", /* wake_str */
  1288. #endif /* VMS */
  1289. #endif /* OS2 */
  1290. 0, /* wake_rate */
  1291. "OK\015", /* wake_prompt */
  1292. "", /* dmode_str */
  1293. "", /* dmode_prompt */
  1294. "ATD%s\015", /* dial_str */
  1295. 0, /* dial_rate */
  1296. 1100, /* esc_time */
  1297. 43, /* esc_char */
  1298. "ATQ0H0\015", /* hup_str */
  1299. "AT\\Q3\015", /* hwfc_str */
  1300. "AT\\Q1\015", /* swfc_str */
  1301. "AT\\Q0\015", /* nofc_str */
  1302. "AT\\N6\015", /* ec_on_str */
  1303. "AT\\N1\015", /* ec_off_str */
  1304. "AT%C1\015", /* dc_on_str */
  1305. "AT%C0\015", /* dc_off_str */
  1306. "ATS0=1\015", /* aa_on_str */
  1307. "ATS0=0\015", /* aa_off_str */
  1308. "AT\\J0\015", /* sb_on_str */
  1309. "AT\\J1\015", /* sb_off_str */
  1310. "ATM1\015", /* sp_on_str */
  1311. "ATM0\015", /* sp_off_str */
  1312. "ATL1\015", /* vol1_str */
  1313. "ATL2\015", /* vol2_str */
  1314. "ATL3\015", /* vol3_str */
  1315. "ATX3\015", /* ignoredt */
  1316. "", /* ini2 */
  1317. 57600L, /* max_speed */
  1318. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1319. getok /* ok_fn */
  1320. };
  1321. static
  1322. MDMINF BOCA = /* Boca */
  1323. {
  1324. "BOCA 14.4 Faxmodem",
  1325. "ATP\015", /* pulse command */
  1326. "ATT\015", /* tone command */
  1327. 35, /* dial_time */
  1328. ",", /* pause_chars */
  1329. 2, /* pause_time */
  1330. #ifdef OS2
  1331. "ATE1Q0V1F1N1W1&S0&C1&D2\\K5S37=11S82=128S95=47X4\015", /* wake_str */
  1332. #else
  1333. #ifdef VMS
  1334. "ATQ0E1F1N1W1&S1\\K5S37=11S82=128S95=47X4\015", /* wake_str */
  1335. #else
  1336. "ATQ0E1F1N1W1\\K5S37=11S82=128S95=47X4\015", /* wake_str */
  1337. #endif /* VMS */
  1338. #endif /* OS2 */
  1339. 0, /* wake_rate */
  1340. "OK\015", /* wake_prompt */
  1341. "", /* dmode_str */
  1342. "", /* dmode_prompt */
  1343. "ATD%s\015", /* dial_str */
  1344. 0, /* dial_rate */
  1345. 1100, /* esc_time */
  1346. 43, /* esc_char */
  1347. "ATQ0H0\015", /* hup_str */
  1348. "AT&K3\015", /* hwfc_str */
  1349. "AT&K4\015", /* swfc_str */
  1350. "AT&K0\015", /* nofc_str */
  1351. "AT\\N3S36=7S48=7\015", /* ec_on_str */
  1352. "AT\\N1\015", /* ec_off_str */
  1353. "ATS46=138\015", /* dc_on_str */
  1354. "ATS46=136\015", /* dc_off_str */
  1355. "ATS0=1\015", /* aa_on_str */
  1356. "ATS0=0\015", /* aa_off_str */
  1357. "", /* sb_on_str */
  1358. "", /* sb_off_str */
  1359. "ATM1\015", /* sp_on_str */
  1360. "ATM0\015", /* sp_off_str */
  1361. "ATL1\015", /* vol1_str */
  1362. "ATL2\015", /* vol2_str */
  1363. "ATL3\015", /* vol3_str */
  1364. "ATX3\015", /* ignoredt */
  1365. "", /* ini2 */
  1366. 57600L, /* max_speed */
  1367. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1368. getok /* ok_fn */
  1369. };
  1370. static
  1371. MDMINF INTEL = /* Intel */
  1372. {
  1373. "Intel High-Speed Faxmodem",
  1374. "ATP\015", /* pulse command */
  1375. "ATT\015", /* tone command */
  1376. 35, /* dial_time */
  1377. ",", /* pause_chars */
  1378. 2, /* pause_time */
  1379. #ifdef OS2
  1380. "ATE1Q0V1Y0X4&S0&C1&D2\\K1\\V2S25=50\015", /* wake_str */
  1381. #else
  1382. #ifdef VMS
  1383. "ATQ0E1Y0X4&S1\\K1\\V2S25=50\015", /* wake_str */
  1384. #else
  1385. "ATQ0E1Y0X4\\K1\\V2S25=50\015", /* wake_str */
  1386. #endif /* VMS */
  1387. #endif /* OS2 */
  1388. 0, /* wake_rate */
  1389. "OK\015", /* wake_prompt */
  1390. "ATB1+FCLASS=0\015", /* dmode_str */
  1391. "OK\015", /* dmode_prompt */
  1392. "ATD%s\015", /* dial_str */
  1393. 0, /* dial_rate */
  1394. 1100, /* esc_time */
  1395. 43, /* esc_char */
  1396. "ATQ0H0\015", /* hup_str */
  1397. "AT\\G1\\Q3\015", /* hwfc_str */
  1398. "AT\\G1\\Q1\\X0\015", /* swfc_str */
  1399. "AT\\G0\015", /* nofc_str */
  1400. "AT\\J0\\N3\"H3\015", /* ec_on_str */
  1401. "AT\\N1\015", /* ec_off_str */
  1402. "AT%C1\015", /* dc_on_str */
  1403. "AT%C0\015", /* dc_off_str */
  1404. "ATS0=1\015", /* aa_on_str */
  1405. "ATS0=0\015", /* aa_off_str */
  1406. "", /* sb_on_str */
  1407. "", /* sb_off_str */
  1408. "ATM1\015", /* sp_on_str */
  1409. "ATM0\015", /* sp_off_str */
  1410. "ATL1\015", /* vol1_str */
  1411. "ATL2\015", /* vol2_str */
  1412. "ATL3\015", /* vol3_str */
  1413. "ATX3\015", /* ignoredt */
  1414. "", /* ini2 */
  1415. 57600L, /* max_speed */
  1416. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1417. getok /* ok_fn */
  1418. };
  1419. static
  1420. MDMINF MULTITECH = /* Multitech */
  1421. {
  1422. "Multitech MT1432 or MT2834 Series",
  1423. "ATP\015", /* pulse command */
  1424. "ATT\015", /* tone command */
  1425. 35, /* dial_time */
  1426. ",", /* pause_chars */
  1427. 2, /* pause_time */
  1428. /* #P0 (= no parity) is not listed in the manual for newer models */
  1429. /* so it has been removed from all three copies of the Multitech wake_str */
  1430. #ifdef OS2
  1431. "ATE1Q0V1X4&S0&C1&D2&E8&Q0\015", /* wake_str */
  1432. #else
  1433. #ifdef VMS
  1434. "ATQ0E1X4&S1&E8&Q0\015", /* wake_str */
  1435. #else
  1436. "ATQ0E1X4&E8&Q0\015", /* wake_str */
  1437. #endif /* VMS */
  1438. #endif /* OS2 */
  1439. 0, /* wake_rate */
  1440. "OK\015", /* wake_prompt */
  1441. "", /* dmode_str */
  1442. "", /* dmode_prompt */
  1443. "ATD%s\015", /* dial_str */
  1444. 0, /* dial_rate */
  1445. 1100, /* esc_time */
  1446. 43, /* esc_char */
  1447. "ATQ0H0\015", /* hup_str */
  1448. "AT&E4&E7&E8&E11&E13\015", /* hwfc_str */
  1449. "AT&E5&E6&E8&E11&E13\015", /* swfc_str */
  1450. "AT&E3&E7&E8&E10&E12\015", /* nofc_str */
  1451. "AT&E1\015", /* ec_on_str */
  1452. "AT&E0\015", /* ec_off_str */
  1453. "AT&E15\015", /* dc_on_str */
  1454. "AT&E14\015", /* dc_off_str */
  1455. "ATS0=1\015", /* aa_on_str */
  1456. "ATS0=0\015", /* aa_off_str */
  1457. "AT$BA0\015", /* sb_on_str (= "baud adjust off") */
  1458. "AT$BA1\015", /* sb_off_str */
  1459. "ATM1\015", /* sp_on_str */
  1460. "ATM0\015", /* sp_off_str */
  1461. "ATL1\015", /* vol1_str */
  1462. "ATL2\015", /* vol2_str */
  1463. "ATL3\015", /* vol3_str */
  1464. "ATX3\015", /* ignoredt */
  1465. "", /* ini2 */
  1466. 57600L, /* max_speed */
  1467. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1468. getok /* ok_fn */
  1469. };
  1470. static
  1471. MDMINF SUPRA = /* Supra */
  1472. {
  1473. "SupraFAXModem 144 or 288",
  1474. "ATP\015", /* pulse command */
  1475. "ATT\015", /* tone command */
  1476. 35, /* dial_time */
  1477. ",", /* pause_chars */
  1478. 2, /* pause_time */
  1479. #ifdef OS2
  1480. "ATQ0E1V1N1W0X4Y0&S0&C1&D2\\K5S82=128\015", /* wake_str */
  1481. #else
  1482. #ifdef VMS
  1483. "ATQ0E1N1W0X4Y0&S1\\K5S82=128\015", /* wake_str */
  1484. #else
  1485. "ATQ0E1N1W0X4Y0\\K5S82=128\015", /* wake_str */
  1486. #endif /* VMS */
  1487. #endif /* OS2 */
  1488. 0, /* wake_rate */
  1489. "OK\015", /* wake_prompt */
  1490. "", /* dmode_str */
  1491. "", /* dmode_prompt */
  1492. "ATD%s\015", /* dial_str */
  1493. 0, /* dial_rate */
  1494. 1100, /* esc_time */
  1495. 43, /* esc_char */
  1496. "ATQ0H0\015", /* hup_str */
  1497. "AT&K3\015", /* hwfc_str */
  1498. "AT&K4\015", /* swfc_str */
  1499. "AT&K0\015", /* nofc_str */
  1500. "AT&Q5\\N3S48=7\015", /* ec_on_str */
  1501. "AT&Q0\\N1\015", /* ec_off_str */
  1502. "AT%C1S46=138\015", /* dc_on_str */
  1503. "AT%C0S46=136\015", /* dc_off_str */
  1504. "ATS0=1\015", /* aa_on_str */
  1505. "ATS0=0\015", /* aa_off_str */
  1506. "", /* sb_on_str */
  1507. "", /* sb_off_str */
  1508. "ATM1\015", /* sp_on_str */
  1509. "ATM\015", /* sp_off_str */
  1510. "ATL\015", /* vol1_str */
  1511. "ATL2\015", /* vol2_str */
  1512. "ATL3\015", /* vol3_str */
  1513. "ATX3\015", /* ignoredt */
  1514. "", /* ini2 */
  1515. 57600L, /* max_speed */
  1516. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1517. getok /* ok_fn */
  1518. };
  1519. static
  1520. MDMINF SUPRAX = /* Supra Express */
  1521. {
  1522. "Diamond Supra Express V.90",
  1523. "ATP\015", /* pulse command */
  1524. "ATT\015", /* tone command */
  1525. 35, /* dial_time */
  1526. ",", /* pause_chars */
  1527. 2, /* pause_time */
  1528. #ifdef OS2
  1529. "ATQ0E1V1W0X4&C1&D2&S0\\K5\015", /* wake_str */
  1530. #else
  1531. #ifdef VMS
  1532. "ATQ0E1W0X4&S1\\K5\015", /* wake_str */
  1533. #else
  1534. "ATQ0E1W0X4\\K5\015", /* wake_str */
  1535. #endif /* VMS */
  1536. #endif /* OS2 */
  1537. 0, /* wake_rate */
  1538. "OK\015", /* wake_prompt */
  1539. "", /* dmode_str */
  1540. "", /* dmode_prompt */
  1541. "ATD%s\015", /* dial_str */
  1542. 0, /* dial_rate */
  1543. 1100, /* esc_time */
  1544. 43, /* esc_char */
  1545. "ATQ0H0\015", /* hup_str */
  1546. "AT&K3\015", /* hwfc_str */
  1547. "AT&K4\015", /* swfc_str */
  1548. "AT&K0\015", /* nofc_str */
  1549. "AT\\N3\015", /* ec_on_str */
  1550. "AT\\N1\015", /* ec_off_str */
  1551. "AT%C2\015", /* dc_on_str */
  1552. "AT%C0\015", /* dc_off_str */
  1553. "ATS0=1\015", /* aa_on_str */
  1554. "ATS0=0\015", /* aa_off_str */
  1555. "", /* sb_on_str */
  1556. "", /* sb_off_str */
  1557. "ATM1\015", /* sp_on_str */
  1558. "ATM\015", /* sp_off_str */
  1559. "ATL\015", /* vol1_str */
  1560. "ATL2\015", /* vol2_str */
  1561. "ATL3\015", /* vol3_str */
  1562. "ATX3\015", /* ignoredt */
  1563. "", /* ini2 */
  1564. 230400L, /* max_speed */
  1565. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1566. getok /* ok_fn */
  1567. };
  1568. static
  1569. MDMINF MAXTECH = /* MaxTech */
  1570. {
  1571. "MaxTech XM288EA or GVC FAXModem",
  1572. "ATP\015", /* pulse command */
  1573. "ATT\015", /* tone command */
  1574. 35, /* dial_time */
  1575. ",", /* pause_chars */
  1576. 2, /* pause_time */
  1577. #ifdef OS2
  1578. "ATQ0E1V1X4Y0&S0&C1&D2&L0&M0\\K5\015", /* wake_str */
  1579. #else
  1580. #ifdef VMS
  1581. "ATQ0E1X4Y0&L0&M0&S1\\K5\015", /* wake_str */
  1582. #else
  1583. "ATQ0E1X4Y0&L0&M0\\K5\015", /* wake_str */
  1584. #endif /* VMS */
  1585. #endif /* OS2 */
  1586. 0, /* wake_rate */
  1587. "OK\015", /* wake_prompt */
  1588. "", /* dmode_str */
  1589. "", /* dmode_prompt */
  1590. "ATD%s\015", /* dial_str */
  1591. 0, /* dial_rate */
  1592. 1100, /* esc_time */
  1593. 43, /* esc_char */
  1594. "ATQ0H0\015", /* hup_str */
  1595. "AT\\Q3\015", /* hwfc_str */
  1596. "AT\\Q1\\X0\015", /* swfc_str */
  1597. "AT\\Q0\015", /* nofc_str */
  1598. "AT\\N6\015", /* ec_on_str */
  1599. "AT\\N0\015", /* ec_off_str */
  1600. "AT\\N6%C1\015", /* dc_on_str */
  1601. "AT\\N6%C0\015", /* dc_off_str */
  1602. "ATS0=1\015", /* aa_on_str */
  1603. "ATS0=0\015", /* aa_off_str */
  1604. "", /* sb_on_str */
  1605. "", /* sb_off_str */
  1606. "ATM1\015", /* sp_on_str */
  1607. "ATM0\015", /* sp_off_str */
  1608. "ATL1\015", /* vol1_str */
  1609. "ATL2\015", /* vol2_str */
  1610. "ATL3\015", /* vol3_str */
  1611. "ATX3\015", /* ignoredt */
  1612. "", /* ini2 */
  1613. 115200L, /* max_speed */
  1614. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1615. getok /* ok_fn */
  1616. };
  1617. static
  1618. MDMINF ROLM = /* IBM / Siemens / Rolm 8000, 9000, 9751 CBX DCM */
  1619. {
  1620. "IBM/Siemens/Rolm CBX Data Communications Module",
  1621. "", /* pulse command */
  1622. "", /* tone command */
  1623. 60, /* dial_time */
  1624. "", /* pause_chars */
  1625. 0, /* pause_time */
  1626. "\015\015", /* wake_str */
  1627. 50, /* wake_rate */
  1628. "MODIFY?", /* wake_prompt */
  1629. "", /* dmode_str */
  1630. "", /* dmode_prompt */
  1631. "CALL %s\015", /* dial_str */
  1632. 0, /* dial_rate */
  1633. 0, /* esc_time */
  1634. 0, /* esc_char */
  1635. "", /* hup_str */
  1636. "", /* hwfc_str */
  1637. "", /* swfc_str */
  1638. "", /* nofc_str */
  1639. "", /* ec_on_str */
  1640. "", /* ec_off_str */
  1641. "", /* dc_on_str */
  1642. "", /* dc_off_str */
  1643. "", /* aa_on_str */
  1644. "", /* aa_off_str */
  1645. "", /* sb_on_str */
  1646. "", /* sb_off_str */
  1647. "", /* sp_off_str */
  1648. "", /* sp_on_str */
  1649. "", /* vol1_str */
  1650. "", /* vol2_str */
  1651. "", /* vol3_str */
  1652. "", /* ignoredt */
  1653. "", /* ini2 */
  1654. 19200L, /* max_speed */
  1655. 0, /* capas */
  1656. NULL /* ok_fn */
  1657. };
  1658. static
  1659. MDMINF USR = /* USR Courier and Sportster modems */
  1660. {
  1661. "US Robotics Courier, Sportster, or compatible",
  1662. "ATP\015", /* pulse command */
  1663. "ATT\015", /* tone command */
  1664. 35, /* dial_time */
  1665. ",", /* pause_chars */
  1666. 2, /* pause_time */
  1667. #ifdef OS2
  1668. "ATQ0E1V1X4&A3&S0&C1&D2&N0&Y3S14=0\015", /* wake_str */
  1669. #else
  1670. #ifdef SUNOS4
  1671. "ATQ0X4&A3&S0&N0&Y3S14=0\015", /* wake_str -- needs &S0 in SunOS */
  1672. #else
  1673. #ifdef VMS
  1674. "ATQ0X4&A3&S1&N0&Y3S14=0\015", /* wake_str -- needs &S1 in VMS */
  1675. #else
  1676. "ATQ0X4&A3&N0&Y3S14=0\015", /* wake_str */
  1677. #endif /* VMS */
  1678. #endif /* SUNOS4 */
  1679. #endif /* OS2 */
  1680. 0, /* wake_rate */
  1681. "OK\015", /* wake_prompt */
  1682. "", /* dmode_str */
  1683. "", /* dmode_prompt */
  1684. "ATD%s\015", /* dial_str */
  1685. 0, /* dial_rate */
  1686. 1100, /* esc_time */
  1687. 43, /* esc_char */
  1688. "ATQ0H0\015", /* hup_str */
  1689. "AT&H1&R2&I0\015", /* hwfc_str */
  1690. "AT&H2&R1&I2\015", /* swfc_str */
  1691. "AT&H0&R1&I0\015", /* nofc_str */
  1692. "AT&M4&B1\015", /* ec_on_str */
  1693. "AT&M0\015", /* ec_off_str */
  1694. "AT&K1\015", /* dc_on_str */
  1695. "AT&K0\015", /* dc_off_str */
  1696. "ATS0=1\015", /* aa_on_str */
  1697. "ATS0=0\015", /* aa_off_str */
  1698. "", /* sb_on_str */
  1699. "", /* sb_off_str */
  1700. "ATM1\015", /* sp_on_str */
  1701. "ATM0\015", /* sp_off_str */
  1702. "ATL1\015", /* vol1_str */
  1703. "ATL2\015", /* vol2_str */
  1704. "ATL3\015", /* vol3_str */
  1705. "ATX3\015", /* ignoredt */
  1706. "", /* ini2 */
  1707. 115200L, /* max_speed */
  1708. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1709. getok /* ok_fn */
  1710. };
  1711. static
  1712. MDMINF USRX2 = /* USR XJ-CC1560 X2 56K */
  1713. {
  1714. "US Robotics / Megahertz CC/XJ-CC1560 X2",
  1715. "ATP\015", /* pulse command */
  1716. "ATT\015", /* tone command */
  1717. 35, /* dial_time */
  1718. ",", /* pause_chars */
  1719. 2, /* pause_time */
  1720. #ifdef OS2
  1721. "ATQ0E1V1X4&A3&S0&B2&C1&D2&N0\015", /* wake_str */
  1722. #else
  1723. #ifdef VMS
  1724. "ATQ0X4&A3&B2&N0&S1\015", /* wake_str */
  1725. #else
  1726. "ATQ0X4&A3&B2&N0\015", /* wake_str */
  1727. #endif /* VMS */
  1728. #endif /* OS2 */
  1729. 0, /* wake_rate */
  1730. "OK\015", /* wake_prompt */
  1731. "", /* dmode_str */
  1732. "", /* dmode_prompt */
  1733. "ATD%s\015", /* dial_str */
  1734. 0, /* dial_rate */
  1735. 1100, /* esc_time */
  1736. 43, /* esc_char */
  1737. "ATQ0H0\015", /* hup_str */
  1738. "AT&H1&I0\015", /* hwfc_str */
  1739. "AT&H2&I2\015", /* swfc_str */
  1740. "AT&H0&I0\015", /* nofc_str */
  1741. "AT&M4\015", /* ec_on_str */
  1742. "AT&M0\015", /* ec_off_str */
  1743. "AT&K1\015", /* dc_on_str */
  1744. "AT&K0\015", /* dc_off_str */
  1745. "ATS0=1\015", /* aa_on_str */
  1746. "ATS0=0\015", /* aa_off_str */
  1747. "AT&B1\015", /* sb_on_str */
  1748. "AT&B0\015", /* sb_off_str */
  1749. "ATM1\015", /* sp_on_str */
  1750. "ATM0\015", /* sp_off_str */
  1751. "ATL1\015", /* vol1_str */
  1752. "ATL2\015", /* vol2_str */
  1753. "ATL3\015", /* vol3_str */
  1754. "ATX3\015", /* ignoredt */
  1755. "", /* ini2 */
  1756. 115200L, /* max_speed */
  1757. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1758. getok /* ok_fn */
  1759. };
  1760. static
  1761. MDMINF OLDTB = /* Old Telebits */
  1762. {
  1763. "Telebit TrailBlazer, T1000, T1500, T2000, T2500",
  1764. "ATP\015", /* pulse command */
  1765. "ATT\015", /* tone command */
  1766. 60, /* dial_time */
  1767. ",", /* pause_chars */
  1768. 2, /* pause_time */
  1769. #ifdef OS2
  1770. "\021AAAAATQ0E1V1X1&S0&C1&D2S12=50S50=0S54=3\015", /* wake_str. */
  1771. #else
  1772. #ifdef VMS
  1773. "\021AAAAATQ0X1S12=50S50=0S54=3\015", /* wake_str. */
  1774. #else
  1775. "\021AAAAATQ0X1&S1S12=50S50=0S54=3\015", /* wake_str. */
  1776. #endif /* VMS */
  1777. #endif /* OS2 */
  1778. 100, /* wake_rate = 100 msec */
  1779. "OK\015", /* wake_prompt */
  1780. "", /* dmode_str */
  1781. "", /* dmode_prompt */
  1782. "ATD%s\015", /* dial_str, Note: no T or P */
  1783. 80, /* dial_rate */
  1784. 1100, /* esc_time (guard time) */
  1785. 43, /* esc_char */
  1786. "ATQ0H0\015", /* hup_str */
  1787. "ATS58=2S68=2\015", /* hwfc_str */
  1788. "ATS58=3S68=3S69=0\015", /* swfc_str */
  1789. "ATS58=0S68=0\015", /* nofc_str */
  1790. "ATS66=1S95=2\015", /* ec_on_str */
  1791. "ATS95=0\015", /* ec_off_str */
  1792. "ATS110=1S96=1\015", /* dc_on_str */
  1793. "ATS110=0S96=0\015", /* dc_off_str */
  1794. "ATS0=1\015", /* aa_on_str */
  1795. "ATS0=0\015", /* aa_off_str */
  1796. "", /* sb_on_str */
  1797. "", /* sb_off_str */
  1798. "ATM1\015", /* sp_on_str */
  1799. "ATM0\015", /* sp_off_str */
  1800. "ATL1\015", /* vol1_str */
  1801. "ATL2\015", /* vol2_str */
  1802. "ATL3\015", /* vol3_str */
  1803. "ATX3\015", /* ignoredt */
  1804. "", /* ini2 */
  1805. 19200L, /* max_speed */
  1806. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_TB|CKD_KS, /* capas */
  1807. getok /* ok_fn */
  1808. };
  1809. static
  1810. MDMINF NEWTB = /* New Telebits */
  1811. {
  1812. "Telebit T1600, T3000, QBlazer, WorldBlazer, etc.",
  1813. "ATP\015", /* pulse command */
  1814. "ATT\015", /* tone command */
  1815. 60, /* dial_time */
  1816. ",", /* pause_chars */
  1817. 2, /* pause_time */
  1818. #ifdef OS2
  1819. "\021AAAAATQ0E1V1X2&S0&C1&D2S12=50S50=0S61=0S63=0\015", /* wake_str. */
  1820. #else
  1821. #ifdef VMS
  1822. "\021AAAAATQ0X2&S1S12=50S50=0S61=0S63=0\015", /* wake_str. */
  1823. #else
  1824. "\021AAAAATQ0X2S12=50S50=0S61=0S63=0\015", /* wake_str. */
  1825. #endif /* VMS */
  1826. #endif /* OS2 */
  1827. 100, /* wake_rate = 100 msec */
  1828. "OK\015", /* wake_prompt */
  1829. "", /* dmode_str */
  1830. "", /* dmode_prompt */
  1831. "ATD%s\015", /* dial_str, Note: no T or P */
  1832. 80, /* dial_rate */
  1833. 1100, /* esc_time (guard time) */
  1834. 43, /* esc_char */
  1835. "ATQ0H0\015", /* hup_str */
  1836. "ATS58=2S68=2\015", /* hwfc_str */
  1837. "ATS58=3S68=3\015", /* swfc_str */
  1838. "ATS58=0S68=0\015", /* nofc_str */
  1839. "ATS180=3\015", /* ec_on_str */
  1840. "ATS180=0\015", /* ec_off_str */
  1841. "ATS190=1\015", /* dc_on_str */
  1842. "ATS190=0\015", /* dc_off_str */
  1843. "ATS0=1\015", /* aa_on_str */
  1844. "ATS0=0\015", /* aa_off_str */
  1845. "", /* sb_on_str */
  1846. "", /* sb_off_str */
  1847. "ATM1\015", /* sp_on_str */
  1848. "ATM0\015", /* sp_off_str */
  1849. "ATL1\015", /* vol1_str */
  1850. "ATL2\015", /* vol2_str */
  1851. "ATL3\015", /* vol3_str */
  1852. "ATX3\015", /* ignoredt */
  1853. "", /* ini2 */
  1854. 38400L, /* max_speed */
  1855. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_TB|CKD_KS, /* capas */
  1856. getok /* ok_fn */
  1857. };
  1858. #endif /* MINIDIAL */
  1859. static
  1860. MDMINF DUMMY = /* dummy information for modems that are handled elsewhere */
  1861. {
  1862. "(dummy)",
  1863. "", /* pulse command */
  1864. "", /* tone command */
  1865. 30, /* dial_time */
  1866. "", /* pause_chars */
  1867. 0, /* pause_time */
  1868. "", /* wake_str */
  1869. 0, /* wake_rate */
  1870. "", /* wake_prompt */
  1871. "", /* dmode_str */
  1872. NULL, /* dmode_prompt */
  1873. "%s\015", /* dial_str */
  1874. 0, /* dial_rate */
  1875. 0, /* esc_time */
  1876. 0, /* esc_char */
  1877. "", /* hup_str */
  1878. "", /* hwfc_str */
  1879. "", /* swfc_str */
  1880. "", /* nofc_str */
  1881. "", /* ec_on_str */
  1882. "", /* ec_off_str */
  1883. "", /* dc_on_str */
  1884. "", /* dc_off_str */
  1885. "", /* aa_on_str */
  1886. "", /* aa_off_str */
  1887. "", /* sb_on_str */
  1888. "", /* sb_off_str */
  1889. "", /* sp_off_str */
  1890. "", /* sp_on_str */
  1891. "", /* vol1_str */
  1892. "", /* vol2_str */
  1893. "", /* vol3_str */
  1894. "", /* ignoredt */
  1895. "", /* ini2 */
  1896. 0L, /* max_speed */
  1897. 0, /* capas */
  1898. NULL /* ok_fn */
  1899. };
  1900. #ifndef MINIDIAL
  1901. static
  1902. MDMINF RWV32 = /* Generic Rockwell V.32 */
  1903. {
  1904. "Generic Rockwell V.32 modem", /* ATI3, ATI4, and ATI6 for details */
  1905. "ATP\015", /* pulse command */
  1906. "ATT\015", /* tone command */
  1907. 35, /* dial_time */
  1908. ",", /* pause_chars */
  1909. 2, /* pause_time */
  1910. #ifdef OS2
  1911. "ATQ0E1V1X4Y0&S0&C1&D2%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1912. #else
  1913. #ifdef VMS
  1914. "ATQ0X4Y0&S1%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1915. #else
  1916. "ATQ0X4Y0%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1917. #endif /* VMS */
  1918. #endif /* OS2 */
  1919. 0, /* wake_rate */
  1920. "OK\015", /* wake_prompt */
  1921. "", /* dmode_str */
  1922. "", /* dmode_prompt */
  1923. "ATD%s\015", /* dial_str */
  1924. 0, /* dial_rate */
  1925. 1100, /* esc_time */
  1926. 43, /* esc_char */
  1927. "ATQ0H0\015", /* hup_str */
  1928. "AT&K3\015", /* hwfc_str */
  1929. "AT&K4S32=17S33=19\015", /* swfc_str */
  1930. "AT&K0\015", /* nofc_str */
  1931. "AT&Q6\015", /* ec_on_str */
  1932. "AT&Q0\015", /* ec_off_str */
  1933. "AT%C1\015", /* dc_on_str */
  1934. "AT%C0\015", /* dc_off_str */
  1935. "ATS0=1\015", /* aa_on_str */
  1936. "ATS0=0\015", /* aa_off_str */
  1937. "", /* sb_on_str */
  1938. "", /* sb_off_str */
  1939. "ATM1\015", /* sp_on_str */
  1940. "ATM0\015", /* sp_off_str */
  1941. "ATL1\015", /* vol1_str */
  1942. "ATL2\015", /* vol2_str */
  1943. "ATL3\015", /* vol3_str */
  1944. "ATX3\015", /* ignoredt */
  1945. "", /* ini2 */
  1946. 57600L, /* max_speed */
  1947. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1948. getok /* ok_fn */
  1949. };
  1950. static
  1951. MDMINF RWV32B = /* Generic Rockwell V.32bis */
  1952. {
  1953. "Generic Rockwell V.32bis modem", /* ATI3, ATI4, and ATI6 for details */
  1954. "ATP\015", /* pulse command */
  1955. "ATT\015", /* tone command */
  1956. 35, /* dial_time */
  1957. ",", /* pause_chars */
  1958. 2, /* pause_time */
  1959. #ifdef OS2
  1960. "ATQ0E1V1X4Y0&S0&C1&D2%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1961. #else
  1962. #ifdef VMS
  1963. "ATQ0X4Y0&S1%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1964. #else
  1965. "ATQ0X4Y0%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
  1966. #endif /* VMS */
  1967. #endif /* OS2 */
  1968. 0, /* wake_rate */
  1969. "OK\015", /* wake_prompt */
  1970. "", /* dmode_str */
  1971. "", /* dmode_prompt */
  1972. "ATD%s\015", /* dial_str */
  1973. 0, /* dial_rate */
  1974. 1100, /* esc_time */
  1975. 43, /* esc_char */
  1976. "ATQ0H0\015", /* hup_str */
  1977. "AT&K3\015", /* hwfc_str */
  1978. "AT&K4S32=17S33=19\015", /* swfc_str */
  1979. "AT&K0\015", /* nofc_str */
  1980. "AT&Q5\015", /* ec_on_str */
  1981. "AT&Q0\015", /* ec_off_str */
  1982. "ATS%C1\015", /* dc_on_str */
  1983. "ATS%C0\015", /* dc_off_str */
  1984. "ATS0=1\015", /* aa_on_str */
  1985. "ATS0=0\015", /* aa_off_str */
  1986. "", /* sb_on_str */
  1987. "", /* sb_off_str */
  1988. "ATM1\015", /* sp_on_str */
  1989. "ATM0\015", /* sp_off_str */
  1990. "ATL1\015", /* vol1_str */
  1991. "ATL2\015", /* vol2_str */
  1992. "ATL3\015", /* vol3_str */
  1993. "ATX3\015", /* ignoredt */
  1994. "", /* ini2 */
  1995. 57600L, /* max_speed */
  1996. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  1997. getok /* ok_fn */
  1998. };
  1999. static
  2000. MDMINF RWV34 = /* Generic Rockwell V.34 Data/Fax */
  2001. {
  2002. "Generic Rockwell V.34 modem", /* ATI3, ATI4, and ATI6 for details */
  2003. "ATP\015", /* pulse command */
  2004. "ATT\015", /* tone command */
  2005. 35, /* dial_time */
  2006. ",", /* pause_chars */
  2007. 2, /* pause_time */
  2008. #ifdef OS2
  2009. "ATQ0V1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0\015", /* wake_str */
  2010. #else
  2011. #ifdef VMS
  2012. "ATQ0V1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0\015", /* wake_str */
  2013. #else
  2014. "ATQ0V1X4Y0&C1&D2%E2\\K5+FCLASS=0\015", /* wake_str */
  2015. #endif /* VMS */
  2016. #endif /* OS2 */
  2017. 0, /* wake_rate */
  2018. "OK\015", /* wake_prompt */
  2019. "", /* dmode_str */
  2020. "", /* dmode_prompt */
  2021. "ATD%s\015", /* dial_str */
  2022. 0, /* dial_rate */
  2023. 1100, /* esc_time */
  2024. 43, /* esc_char */
  2025. "ATQ0H0\015", /* hup_str */
  2026. "AT&K3\015", /* hwfc_str */
  2027. "AT&K4S32=17S33=19\015", /* swfc_str */
  2028. "AT&K0\015", /* nofc_str */
  2029. "AT&Q5\015", /* ec_on_str */
  2030. "AT&Q0\015", /* ec_off_str */
  2031. "ATS%C3\015", /* dc_on_str */
  2032. "ATS%C0\015", /* dc_off_str */
  2033. "ATS0=1\015", /* aa_on_str */
  2034. "ATS0=0\015", /* aa_off_str */
  2035. "", /* sb_on_str */
  2036. "", /* sb_off_str */
  2037. "ATM1\015", /* sp_on_str */
  2038. "ATM0\015", /* sp_off_str */
  2039. "ATL1\015", /* vol1_str */
  2040. "ATL2\015", /* vol2_str */
  2041. "ATL3\015", /* vol3_str */
  2042. "ATX3\015", /* ignoredt */
  2043. "", /* ini2 */
  2044. 115200L, /* max_speed */
  2045. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2046. getok /* ok_fn */
  2047. };
  2048. static
  2049. MDMINF RWV90 = /* Generic Rockwell V.90 Data/Fax */
  2050. {
  2051. "Generic Rockwell V.90 56K modem", /* ATI3, ATI4, and ATI6 for details */
  2052. "ATP\015", /* pulse command */
  2053. "ATT\015", /* tone command */
  2054. 35, /* dial_time */
  2055. ",", /* pause_chars */
  2056. 2, /* pause_time */
  2057. #ifdef OS2
  2058. "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
  2059. #else
  2060. #ifdef VMS
  2061. "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* wake_str */
  2062. #else
  2063. "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* wake_str */
  2064. #endif /* VMS */
  2065. #endif /* OS2 */
  2066. 0, /* wake_rate */
  2067. "OK\015", /* wake_prompt */
  2068. "", /* dmode_str */
  2069. "", /* dmode_prompt */
  2070. "ATD%s\015", /* dial_str */
  2071. 0, /* dial_rate */
  2072. 1100, /* esc_time */
  2073. 43, /* esc_char */
  2074. "ATQ0H0\015", /* hup_str */
  2075. "AT&K3\015", /* hwfc_str */
  2076. "AT&K4S32=17S33=19\015", /* swfc_str */
  2077. "AT&K0\015", /* nofc_str */
  2078. "AT&Q5\015", /* ec_on_str */
  2079. "AT&Q0\015", /* ec_off_str */
  2080. "AT%C3\015", /* dc_on_str */
  2081. "AT%C0\015", /* dc_off_str */
  2082. "ATS0=1\015", /* aa_on_str */
  2083. "ATS0=0\015", /* aa_off_str */
  2084. "", /* sb_on_str */
  2085. "", /* sb_off_str */
  2086. "ATM1\015", /* sp_on_str */
  2087. "ATM0\015", /* sp_off_str */
  2088. "ATL1\015", /* vol1_str */
  2089. "ATL2\015", /* vol2_str */
  2090. "ATL3\015", /* vol3_str */
  2091. "ATX3\015", /* ignoredt */
  2092. "", /* ini2 */
  2093. 115200L, /* max_speed */
  2094. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2095. getok /* ok_fn */
  2096. };
  2097. static
  2098. MDMINF MWAVE = /* IBM Mwave */
  2099. {
  2100. "IBM Mwave Adapter",
  2101. "ATP\015", /* pulse command */
  2102. "ATT\015", /* tone command */
  2103. 35, /* dial_time */
  2104. ",", /* pause_chars */
  2105. 2, /* pause_time */
  2106. #ifdef OS2
  2107. "ATQ0E1V1X4Y0&S0&C1&D2&M0&Q0&N1\\K3\\T0%E2S28=0\015", /* wake_str */
  2108. #else
  2109. #ifdef VMS
  2110. "ATQ0X4Y0&M0&S1&Q0&N1&S0\\K3\\T0%E2S28=0\015", /* wake_str */
  2111. #else
  2112. "ATQ0X4Y0&M0&Q0&N1&S0\\K3\\T0%E2S28=0\015", /* wake_str */
  2113. #endif /* VMS */
  2114. #endif /* OS2 */
  2115. 0, /* wake_rate */
  2116. "OK\015", /* wake_prompt */
  2117. "", /* dmode_str */
  2118. "", /* dmode_prompt */
  2119. "ATD%s\015", /* dial_str */
  2120. 0, /* dial_rate */
  2121. 1100, /* esc_time */
  2122. 43, /* esc_char */
  2123. "ATQ0H0\015", /* hup_str */
  2124. "AT\\Q3\015", /* hwfc_str */
  2125. "", /* swfc_str (it doesn't!) */
  2126. "AT\\Q0\015", /* nofc_str */
  2127. "AT\\N7\015", /* ec_on_str */
  2128. "AT\\N0\015", /* ec_off_str */
  2129. "AT%C1\"H3\015", /* dc_on_str */
  2130. "AT%C0\"H0\015", /* dc_off_str */
  2131. "ATS0=1\015", /* aa_on_str */
  2132. "ATS0=0\015", /* aa_off_str */
  2133. "", /* sb_on_str */
  2134. "", /* sb_off_str */
  2135. "ATM1\015", /* sp_on_str */
  2136. "ATM0\015", /* sp_off_str */
  2137. "ATL1\015", /* vol1_str */
  2138. "ATL2\015", /* vol2_str */
  2139. "ATL3\015", /* vol3_str */
  2140. "ATX3\015", /* ignoredt */
  2141. "", /* ini2 */
  2142. 57600L, /* max_speed */
  2143. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
  2144. getok /* ok_fn */
  2145. };
  2146. static
  2147. MDMINF TELEPATH = /* Gateway 2000 Telepath */
  2148. {
  2149. "Gateway 2000 Telepath II 28.8",
  2150. "ATP\015", /* pulse command */
  2151. "ATT\015", /* tone command */
  2152. 35, /* dial_time */
  2153. ",", /* pause_chars */
  2154. 2, /* pause_time */
  2155. #ifdef OS2
  2156. "ATQ0E1V1X4&S0&C1&D2&N0&Y2#CLS=0S13=0S15=0S19=0\015", /* wake_str */
  2157. #else
  2158. #ifdef VMS
  2159. "ATQ0X4&N0&S1&Y1#CLS=0S13=0S15=0S19=0\015", /* wake_str */
  2160. #else
  2161. "ATQ0X4&N0&Y1#CLS=0S13=0S15=0S19=0\015", /* wake_str */
  2162. #endif /* VMS */
  2163. #endif /* OS2 */
  2164. 0, /* wake_rate */
  2165. "OK\015", /* wake_prompt */
  2166. "", /* dmode_str */
  2167. "", /* dmode_prompt */
  2168. "ATD%s\015", /* dial_str */
  2169. 0, /* dial_rate */
  2170. 1100, /* esc_time */
  2171. 43, /* esc_char */
  2172. "ATQ0H0\015", /* hup_str */
  2173. "AT&H1&R2\015", /* hwfc_str */
  2174. "AT&H2&I2S22=17S23=19\015", /* swfc_str */
  2175. "AT&H0&I0&R1\015", /* nofc_str */
  2176. "AT&M4&B1\015", /* ec_on_str -- also fixes speed */
  2177. "AT&M0\015", /* ec_off_str */
  2178. "AT&K1\015", /* dc_on_str */
  2179. "AT&K0\015", /* dc_off_str */
  2180. "ATS0=1\015", /* aa_on_str */
  2181. "ATS0=0\015", /* aa_off_str */
  2182. "", /* sb_on_str */
  2183. "", /* sb_off_str */
  2184. "ATM1\015", /* sp_on_str */
  2185. "ATM0\015", /* sp_off_str */
  2186. "ATL1\015", /* vol1_str */
  2187. "ATL2\015", /* vol2_str */
  2188. "ATL3\015", /* vol3_str */
  2189. "ATX3\015", /* ignoredt */
  2190. "", /* ini2 */
  2191. 57600L, /* max_speed */
  2192. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2193. getok /* ok_fn */
  2194. };
  2195. static
  2196. MDMINF CARDINAL = /* Cardinal - based on Rockwell V.34 */
  2197. {
  2198. "Cardinal MVP288X Series", /* ATI3, ATI4, and ATI6 for details */
  2199. "ATP\015", /* pulse command */
  2200. "ATT\015", /* tone command */
  2201. 35, /* dial_time */
  2202. ",", /* pause_chars */
  2203. 2, /* pause_time */
  2204. #ifdef OS2
  2205. "ATQ0E1V1X4W1Y0%E2&S0&C1&D2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
  2206. #else
  2207. #ifdef VMS
  2208. "ATQ0X4W1Y0&S1%E2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
  2209. #else
  2210. "ATQ0X4W1Y0%E2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
  2211. #endif /* VMS */
  2212. #endif /* OS2 */
  2213. 0, /* wake_rate */
  2214. "OK\015", /* wake_prompt */
  2215. "", /* dmode_str */
  2216. "", /* dmode_prompt */
  2217. "ATD%s\015", /* dial_str */
  2218. 0, /* dial_rate */
  2219. 1100, /* esc_time */
  2220. 43, /* esc_char */
  2221. "ATQ0H0\015", /* hup_str */
  2222. "AT&K3\015", /* hwfc_str */
  2223. "AT&K4S32=17S33=19\015", /* swfc_str */
  2224. "AT&K0\015", /* nofc_str */
  2225. "AT&Q5S36=7S48=7\\N3\015", /* ec_on_str */
  2226. "AT&Q0S48=128\\N1\015", /* ec_off_str */
  2227. "ATS46=138%C1\015", /* dc_on_str */
  2228. "ATS46=136%C0\015", /* dc_off_str */
  2229. "ATS0=1\015", /* aa_on_str */
  2230. "ATS0=0\015", /* aa_off_str */
  2231. "", /* sb_on_str */
  2232. "", /* sb_off_str */
  2233. "ATM1\015", /* sp_on_str */
  2234. "ATM0\015", /* sp_off_str */
  2235. "ATL1\015", /* vol1_str */
  2236. "ATL2\015", /* vol2_str */
  2237. "ATL3\015", /* vol3_str */
  2238. "ATX3\015", /* ignoredt */
  2239. "", /* ini2 */
  2240. 115200L, /* max_speed */
  2241. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2242. getok /* ok_fn */
  2243. };
  2244. static
  2245. MDMINF LUCENT = /* Lucent Venus or Data/Fax modem */
  2246. {
  2247. "Lucent Venus chipset",
  2248. "ATP\015", /* pulse command */
  2249. "ATT\015", /* tone command */
  2250. 35, /* dial_time */
  2251. ",", /* pause_chars */
  2252. 2, /* pause_time */
  2253. #ifdef OS2
  2254. "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
  2255. #else
  2256. #ifdef VMS
  2257. "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* VMS */
  2258. #else
  2259. "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* All others */
  2260. #endif /* VMS */
  2261. #endif /* OS2 */
  2262. 0, /* wake_rate */
  2263. "OK\015", /* wake_prompt */
  2264. "", /* dmode_str */
  2265. "", /* dmode_prompt */
  2266. "ATD%s\015", /* dial_str */
  2267. 0, /* dial_rate */
  2268. 1100, /* esc_time */
  2269. 43, /* esc_char */
  2270. "ATQ0H0\015", /* hup_str */
  2271. "AT&K3\015", /* hwfc_str */
  2272. "AT&K4S32=17S33=19\015", /* swfc_str */
  2273. "AT&K0\015", /* nofc_str */
  2274. "AT&Q5\015", /* ec_on_str */
  2275. "AT&Q0\015", /* ec_off_str */
  2276. "AT%C1\015", /* dc_on_str */
  2277. "AT%C0\015", /* dc_off_str */
  2278. "ATS0=1\015", /* aa_on_str */
  2279. "ATS0=0\015", /* aa_off_str */
  2280. "", /* sb_on_str */
  2281. "", /* sb_off_str */
  2282. "ATM1\015", /* sp_on_str */
  2283. "ATM0\015", /* sp_off_str */
  2284. "ATL1\015", /* vol1_str */
  2285. "ATL2\015", /* vol2_str */
  2286. "ATL3\015", /* vol3_str */
  2287. "ATX3\015", /* ignoredt */
  2288. "", /* ini2 */
  2289. 115200L, /* max_speed */
  2290. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2291. getok /* ok_fn */
  2292. };
  2293. static
  2294. MDMINF CONEXANT = /* Conexant family */
  2295. {
  2296. "Conexant family of modems",
  2297. "ATP\015", /* pulse command */
  2298. "ATT\015", /* tone command */
  2299. 35, /* dial_time */
  2300. ",", /* pause_chars */
  2301. 2, /* pause_time */
  2302. #ifdef OS2
  2303. "ATQ0V1X4&C1&D2&S0%E1+FCLASS=0\015", /* K95 */
  2304. #else
  2305. #ifdef VMS
  2306. "ATQ0V1X4&C1&D2&S1%E1+FCLASS=0\015", /* VMS */
  2307. #else
  2308. "ATQ0V1X4&C1&D2%E1+FCLASS=0\015", /* UNIX etc */
  2309. #endif /* VMS */
  2310. #endif /* OS2 */
  2311. 0, /* wake_rate */
  2312. "OK\015", /* wake_prompt */
  2313. "", /* dmode_str */
  2314. "", /* dmode_prompt */
  2315. "ATD%s\015", /* dial_str */
  2316. 0, /* dial_rate */
  2317. 1100, /* esc_time */
  2318. 43, /* esc_char */
  2319. "ATQ0H0\015", /* hup_str */
  2320. "AT&K3\015", /* hwfc_str */
  2321. "AT&K4S32=17S33=19\015", /* swfc_str */
  2322. "AT&K0\015", /* nofc_str */
  2323. "AT&Q5\015", /* ec_on_str */
  2324. "AT&Q0\015", /* ec_off_str */
  2325. "AT%C3\015", /* dc_on_str */
  2326. "AT%C0\015", /* dc_off_str */
  2327. "ATS0=1\015", /* aa_on_str */
  2328. "ATS0=0\015", /* aa_off_str */
  2329. "", /* sb_on_str */
  2330. "", /* sb_off_str */
  2331. "ATM1\015", /* sp_on_str */
  2332. "ATM0\015", /* sp_off_str */
  2333. "ATL1\015", /* vol1_str */
  2334. "ATL2\015", /* vol2_str */
  2335. "ATL3\015", /* vol3_str */
  2336. "ATX3\015", /* ignoredt */
  2337. "", /* ini2 */
  2338. 115200L, /* max_speed */
  2339. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2340. getok /* ok_fn */
  2341. };
  2342. static
  2343. MDMINF PCTEL = /* PCTel chipset */
  2344. {
  2345. "PCTel chipset",
  2346. "ATP\015", /* pulse command */
  2347. "ATT\015", /* tone command */
  2348. 35, /* dial_time */
  2349. ",", /* pause_chars */
  2350. 2, /* pause_time */
  2351. #ifdef OS2
  2352. "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5S37=0\015", /* K95 */
  2353. #else
  2354. #ifdef VMS
  2355. "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5S37=0\015", /* VMS */
  2356. #else
  2357. "ATQ0V1N1X4Y0&C1&D2%E2\\K5S37=0\015", /* UNIX etc */
  2358. #endif /* VMS */
  2359. #endif /* OS2 */
  2360. 0, /* wake_rate */
  2361. "OK\015", /* wake_prompt */
  2362. "", /* dmode_str */
  2363. "", /* dmode_prompt */
  2364. "ATD%s\015", /* dial_str */
  2365. 0, /* dial_rate */
  2366. 1100, /* esc_time */
  2367. 43, /* esc_char */
  2368. "ATQ0H0\015", /* hup_str */
  2369. "AT&K3\015", /* hwfc_str */
  2370. "AT&K4S32=17S33=19\015", /* swfc_str */
  2371. "AT&K0\015", /* nofc_str */
  2372. "AT\\N3\015", /* ec_on_str */
  2373. "AT\\N0\015", /* ec_off_str */
  2374. "AT%C1\015", /* dc_on_str */
  2375. "AT%C0\015", /* dc_off_str */
  2376. "ATS0=1\015", /* aa_on_str */
  2377. "ATS0=0\015", /* aa_off_str */
  2378. "", /* sb_on_str */
  2379. "", /* sb_off_str */
  2380. "ATM1\015", /* sp_on_str */
  2381. "ATM0\015", /* sp_off_str */
  2382. "ATL1\015", /* vol1_str */
  2383. "ATL2\015", /* vol2_str */
  2384. "ATL3\015", /* vol3_str */
  2385. "ATX3\015", /* ignoredt */
  2386. "", /* ini2 */
  2387. 115200L, /* max_speed */
  2388. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2389. getok /* ok_fn */
  2390. };
  2391. static
  2392. MDMINF ZOOMV34 = /* Zoom Telephonics V.34 */
  2393. {
  2394. "Zoom Telephonics V.34",
  2395. "ATP\015", /* pulse command */
  2396. "ATT\015", /* tone command */
  2397. 35, /* dial_time */
  2398. ",", /* pause_chars */
  2399. 2, /* pause_time */
  2400. #ifdef OS2
  2401. "ATQ0V1N1W1X4&S0&C1&D2S82=128\015", /* wake_str */
  2402. #else
  2403. #ifdef VMS
  2404. "ATQ0V1N1W1X4&S1S82=128\015", /* wake_str */
  2405. #else
  2406. "ATQ0V1N1W1X4S82=128S015", /* wake_str */
  2407. #endif /* VMS */
  2408. #endif /* OS2 */
  2409. 0, /* wake_rate */
  2410. "OK\015", /* wake_prompt */
  2411. "", /* dmode_str */
  2412. "", /* dmode_prompt */
  2413. "ATD%s\015", /* dial_str */
  2414. 0, /* dial_rate */
  2415. 1100, /* esc_time */
  2416. 43, /* esc_char */
  2417. "ATQ0H0\015", /* hup_str */
  2418. "AT&K3\015", /* hwfc_str */
  2419. "AT&K4\015S32=17S33=19", /* swfc_str */
  2420. "AT&K0\015", /* nofc_str */
  2421. "AT&Q5\015", /* ec_on_str */
  2422. "AT&Q0\015", /* ec_off_str */
  2423. "ATS%C3\015", /* dc_on_str */
  2424. "ATS%C0\015", /* dc_off_str */
  2425. "ATS0=1\015", /* aa_on_str */
  2426. "ATS0=0\015", /* aa_off_str */
  2427. "", /* sb_on_str */
  2428. "", /* sb_off_str */
  2429. "ATM1\015", /* sp_on_str */
  2430. "ATM0\015", /* sp_off_str */
  2431. "ATL1\015", /* vol1_str */
  2432. "ATL2\015", /* vol2_str */
  2433. "ATL3\015", /* vol3_str */
  2434. "ATX3\015", /* ignoredt */
  2435. "", /* ini2 */
  2436. 57600L, /* max_speed */
  2437. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2438. getok /* ok_fn */
  2439. };
  2440. static
  2441. MDMINF ZOOMV90 = /* ZOOM V.90 */
  2442. {
  2443. "Zoom V.90 56K",
  2444. "ATP\015", /* pulse command */
  2445. "ATT\015", /* tone command */
  2446. 35, /* dial_time */
  2447. ",", /* pause_chars */
  2448. 2, /* pause_time */
  2449. #ifdef OS2
  2450. "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
  2451. #else
  2452. #ifdef VMS
  2453. "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* VMS */
  2454. #else
  2455. "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* All others */
  2456. #endif /* VMS */
  2457. #endif /* OS2 */
  2458. 0, /* wake_rate */
  2459. "OK\015", /* wake_prompt */
  2460. "", /* dmode_str */
  2461. "", /* dmode_prompt */
  2462. "ATD%s\015", /* dial_str */
  2463. 0, /* dial_rate */
  2464. 1100, /* esc_time */
  2465. 43, /* esc_char */
  2466. "ATQ0H0\015", /* hup_str */
  2467. "AT&K3\015", /* hwfc_str */
  2468. "AT&K4S32=17S33=19\015", /* swfc_str */
  2469. "AT&K0\015", /* nofc_str */
  2470. "AT&Q5\015", /* ec_on_str */
  2471. "AT&Q0\015", /* ec_off_str */
  2472. "AT%C1\015", /* dc_on_str */
  2473. "AT%C0\015", /* dc_off_str */
  2474. "ATS0=1\015", /* aa_on_str */
  2475. "ATS0=0\015", /* aa_off_str */
  2476. "", /* sb_on_str */
  2477. "", /* sb_off_str */
  2478. "ATM1\015", /* sp_on_str */
  2479. "ATM0\015", /* sp_off_str */
  2480. "ATL1\015", /* vol1_str */
  2481. "ATL2\015", /* vol2_str */
  2482. "ATL3\015", /* vol3_str */
  2483. "ATX3\015", /* ignoredt */
  2484. "", /* ini2 */
  2485. 115200L, /* max_speed */
  2486. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2487. getok /* ok_fn */
  2488. };
  2489. static
  2490. MDMINF ZOOMV92 = /* ZOOM V.92 */
  2491. {
  2492. "Zoom V.92 with V.44 compression",
  2493. "ATP\015", /* pulse command */
  2494. "ATT\015", /* tone command */
  2495. 35, /* dial_time */
  2496. ",", /* pause_chars */
  2497. 2, /* pause_time */
  2498. #ifdef OS2
  2499. "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* K95 */
  2500. #else
  2501. #ifdef VMS
  2502. "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* VMS */
  2503. #else
  2504. "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* All others */
  2505. #endif /* VMS */
  2506. #endif /* OS2 */
  2507. 0, /* wake_rate */
  2508. "OK\015", /* wake_prompt */
  2509. "", /* dmode_str */
  2510. "", /* dmode_prompt */
  2511. "ATD%s\015", /* dial_str */
  2512. 0, /* dial_rate */
  2513. 1100, /* esc_time */
  2514. 43, /* esc_char */
  2515. "ATQ0H0\015", /* hup_str */
  2516. "AT&K3\015", /* hwfc_str */
  2517. "AT&K4S32=17S33=19\015", /* swfc_str */
  2518. "AT&K0\015", /* nofc_str */
  2519. "AT&Q5\015", /* ec_on_str */
  2520. "AT&Q0\015", /* ec_off_str */
  2521. "AT%C1+DCS=1,1\015", /* dc_on_str */
  2522. "AT%C0\015", /* dc_off_str */
  2523. "ATS0=1\015", /* aa_on_str */
  2524. "ATS0=0\015", /* aa_off_str */
  2525. "", /* sb_on_str */
  2526. "", /* sb_off_str */
  2527. "ATM1\015", /* sp_on_str */
  2528. "ATM0\015", /* sp_off_str */
  2529. "ATL1\015", /* vol1_str */
  2530. "ATL2\015", /* vol2_str */
  2531. "ATL3\015", /* vol3_str */
  2532. "ATX3\015", /* ignoredt */
  2533. "", /* ini2 */
  2534. 115200L, /* max_speed */
  2535. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  2536. getok /* ok_fn */
  2537. };
  2538. /*
  2539. Now the "old" modems, all grouped together, and also within
  2540. "if not defined MINIDIAL"...
  2541. */
  2542. #ifdef OLDMODEMS
  2543. static
  2544. MDMINF CERMETEK = /* Information for "Cermetek Info-Mate 212 A" modem */
  2545. {
  2546. "Cermetek Info-Mate 212 A",
  2547. "", /* pulse command */
  2548. "", /* tone command */
  2549. 20, /* dial_time */
  2550. "BbPpTt", /* pause_chars */
  2551. 0, /* pause_time */
  2552. " XY\016R\015", /* wake_str */
  2553. 200, /* wake_rate */
  2554. "", /* wake_prompt */
  2555. "", /* dmode_str */
  2556. NULL, /* dmode_prompt */
  2557. "\016D '%s'\015", /* dial_str */
  2558. 200, /* dial_rate */
  2559. 0, /* esc_time */
  2560. 0, /* esc_char */
  2561. "", /* hup_str */
  2562. "", /* hwfc_str */
  2563. "", /* swfc_str */
  2564. "", /* nofc_str */
  2565. "", /* ec_on_str */
  2566. "", /* ec_off_str */
  2567. "", /* dc_on_str */
  2568. "", /* dc_off_str */
  2569. "", /* aa_on_str */
  2570. "", /* aa_off_str */
  2571. "", /* sb_on_str */
  2572. "", /* sb_off_str */
  2573. "", /* sp_off_str */
  2574. "", /* sp_on_str */
  2575. "", /* vol1_str */
  2576. "", /* vol2_str */
  2577. "", /* vol3_str */
  2578. "", /* ignoredt */
  2579. "", /* ini2 */
  2580. 1200L, /* max_speed */
  2581. 0, /* capas */
  2582. NULL /* ok_fn */
  2583. };
  2584. static
  2585. MDMINF DF03 = /* information for "DEC DF03-AC" modem */
  2586. {
  2587. "Digital DF03-AC",
  2588. "", /* pulse command */
  2589. "", /* tone command */
  2590. 27, /* dial_time */
  2591. "=", /* pause_chars */
  2592. 15, /* pause_time */
  2593. "\001\002", /* wake_str */
  2594. 0, /* wake_rate */
  2595. "", /* wake_prompt */
  2596. "", /* dmode_str */
  2597. NULL, /* dmode_prompt */
  2598. "%s", /* dial_str */
  2599. 0, /* dial_rate */
  2600. 0, /* esc_time */
  2601. 0, /* esc_char */
  2602. "", /* hup_str */
  2603. "", /* hwfc_str */
  2604. "", /* swfc_str */
  2605. "", /* nofc_str */
  2606. "", /* ec_on_str */
  2607. "", /* ec_off_str */
  2608. "", /* dc_on_str */
  2609. "", /* dc_off_str */
  2610. "", /* aa_on_str */
  2611. "", /* aa_off_str */
  2612. "", /* sb_on_str */
  2613. "", /* sb_off_str */
  2614. "", /* sp_off_str */
  2615. "", /* sp_on_str */
  2616. "", /* vol1_str */
  2617. "", /* vol2_str */
  2618. "", /* vol3_str */
  2619. "", /* ignoredt */
  2620. "", /* ini2 */
  2621. 0L, /* max_speed */
  2622. 0, /* capas */
  2623. NULL /* ok_fn */
  2624. };
  2625. static
  2626. MDMINF DF100 = /* information for "DEC DF100-series" modem */
  2627. /*
  2628. * The telephone "number" can include "P"s and/or "T"s
  2629. * within it to indicate that subsequent digits are
  2630. * to be dialed using pulse or tone dialing. The
  2631. * modem defaults to pulse dialing. You may modify
  2632. * the dial string below to explicitly default all
  2633. * dialing to pulse or tone, but doing so prevents
  2634. * the use of phone numbers that you may have stored
  2635. * in the modem's memory.
  2636. */
  2637. {
  2638. "Digital DF-100",
  2639. "", /* pulse command */
  2640. "", /* tone command */
  2641. 30, /* dial_time */
  2642. "=", /* pause_chars */
  2643. 15, /* pause_time */
  2644. "\001", /* wake_str */
  2645. 0, /* wake_rate */
  2646. "", /* wake_prompt */
  2647. "", /* dmode_str */
  2648. NULL, /* dmode_prompt */
  2649. "%s#", /* dial_str */
  2650. 0, /* dial_rate */
  2651. 0, /* esc_time */
  2652. 0, /* esc_char */
  2653. "", /* hup_str */
  2654. "", /* hwfc_str */
  2655. "", /* swfc_str */
  2656. "", /* nofc_str */
  2657. "", /* ec_on_str */
  2658. "", /* ec_off_str */
  2659. "", /* dc_on_str */
  2660. "", /* dc_off_str */
  2661. "", /* aa_on_str */
  2662. "", /* aa_off_str */
  2663. "", /* sb_on_str */
  2664. "", /* sb_off_str */
  2665. "", /* sp_off_str */
  2666. "", /* sp_on_str */
  2667. "", /* vol1_str */
  2668. "", /* vol2_str */
  2669. "", /* vol3_str */
  2670. "", /* ignoredt */
  2671. "", /* ini2 */
  2672. 0L, /* max_speed */
  2673. 0, /* capas */
  2674. NULL /* ok_fn */
  2675. };
  2676. static
  2677. MDMINF DF200 = /* information for "DEC DF200-series" modem */
  2678. /*
  2679. * The telephone "number" can include "P"s and/or "T"s
  2680. * within it to indicate that subsequent digits are
  2681. * to be dialed using pulse or tone dialing. The
  2682. * modem defaults to pulse dialing. You may modify
  2683. * the dial string below to explicitly default all
  2684. * dialing to pulse or tone, but doing so prevents
  2685. * the use of phone numbers that you may have stored
  2686. * in the modem's memory.
  2687. */
  2688. {
  2689. "Digital DF-200",
  2690. "", /* pulse command */
  2691. "", /* tone command */
  2692. 30, /* dial_time */
  2693. "=W", /* pause_chars */ /* =: second tone; W: 5 secs */
  2694. 15, /* pause_time */ /* worst case */
  2695. "\002", /* wake_str */ /* allow stored number usage */
  2696. 0, /* wake_rate */
  2697. "", /* wake_prompt */
  2698. "", /* dmode_str */
  2699. NULL, /* dmode_prompt */
  2700. #ifdef COMMENT
  2701. "%s!", /* dial_str */
  2702. #else
  2703. " d %s\015",
  2704. #endif /* COMMENT */
  2705. 0, /* dial_rate */
  2706. 0, /* esc_time */
  2707. 0, /* esc_char */
  2708. "", /* hup_str */
  2709. "", /* hwfc_str */
  2710. "", /* swfc_str */
  2711. "", /* nofc_str */
  2712. "", /* ec_on_str */
  2713. "", /* ec_off_str */
  2714. "", /* dc_on_str */
  2715. "", /* dc_off_str */
  2716. "", /* aa_on_str */
  2717. "", /* aa_off_str */
  2718. "", /* sb_on_str */
  2719. "", /* sb_off_str */
  2720. "", /* sp_off_str */
  2721. "", /* sp_on_str */
  2722. "", /* vol1_str */
  2723. "", /* vol2_str */
  2724. "", /* vol3_str */
  2725. "", /* ignoredt */
  2726. "", /* ini2 */
  2727. 0L, /* max_speed */
  2728. 0, /* capas */
  2729. NULL /* ok_fn */
  2730. };
  2731. static
  2732. MDMINF GDC = /* information for "GeneralDataComm 212A/ED" modem */
  2733. {
  2734. "GeneralDataComm 212A/ED",
  2735. "", /* pulse command */
  2736. "", /* tone command */
  2737. 32, /* dial_time */
  2738. "%", /* pause_chars */
  2739. 3, /* pause_time */
  2740. "\015\015", /* wake_str */
  2741. 500, /* wake_rate */
  2742. "$", /* wake_prompt */
  2743. "D\015", /* dmode_str */
  2744. ":", /* dmode_prompt */
  2745. "T%s\015", /* dial_str */
  2746. 0, /* dial_rate */
  2747. 0, /* esc_time */
  2748. 0, /* esc_char */
  2749. "", /* hup_str */
  2750. "", /* hwfc_str */
  2751. "", /* swfc_str */
  2752. "", /* nofc_str */
  2753. "", /* ec_on_str */
  2754. "", /* ec_off_str */
  2755. "", /* dc_on_str */
  2756. "", /* dc_off_str */
  2757. "", /* aa_on_str */
  2758. "", /* aa_off_str */
  2759. "", /* sb_on_str */
  2760. "", /* sb_off_str */
  2761. "", /* sp_off_str */
  2762. "", /* sp_on_str */
  2763. "", /* vol1_str */
  2764. "", /* vol2_str */
  2765. "", /* vol3_str */
  2766. "", /* ignoredt */
  2767. "", /* ini2 */
  2768. 1200L, /* max_speed */
  2769. 0, /* capas */
  2770. NULL /* ok_fn */
  2771. };
  2772. static
  2773. MDMINF PENRIL = /* information for "Penril" modem */
  2774. {
  2775. "Penril modem",
  2776. "", /* pulse command */
  2777. "", /* tone command */
  2778. 50, /* dial_time */
  2779. "", /* pause_chars */
  2780. 0, /* pause_time */
  2781. "\015\015", /* wake_str */
  2782. 300, /* wake_rate */
  2783. ">", /* wake_prompt */
  2784. "k\015", /* dmode_str */
  2785. ":", /* dmode_prompt */
  2786. "%s\015", /* dial_str */
  2787. 0, /* dial_rate */
  2788. 0, /* esc_time */
  2789. 0, /* esc_char */
  2790. "", /* hup_str */
  2791. "", /* hwfc_str */
  2792. "", /* swfc_str */
  2793. "", /* nofc_str */
  2794. "", /* ec_on_str */
  2795. "", /* ec_off_str */
  2796. "", /* dc_on_str */
  2797. "", /* dc_off_str */
  2798. "", /* aa_on_str */
  2799. "", /* aa_off_str */
  2800. "", /* sb_on_str */
  2801. "", /* sb_off_str */
  2802. "", /* sp_off_str */
  2803. "", /* sp_on_str */
  2804. "", /* vol1_str */
  2805. "", /* vol2_str */
  2806. "", /* vol3_str */
  2807. "", /* ignoredt */
  2808. "", /* ini2 */
  2809. 0L, /* max_speed */
  2810. 0, /* capas */
  2811. NULL /* ok_fn */
  2812. };
  2813. static
  2814. MDMINF RACAL = /* Racal Vadic VA4492E */
  2815. {
  2816. "Racal Vadic VA4492E",
  2817. "", /* pulse command */
  2818. "", /* tone command */
  2819. 35, /* dial_time (manual says modem is hardwired to 60) */
  2820. "Kk", /* pause_chars */
  2821. 5, /* pause_time */
  2822. "\005\015", /* wake_str, ^E^M */
  2823. 50, /* wake_rate */
  2824. "*", /* wake_prompt */
  2825. "D\015", /* dmode_str */
  2826. "?", /* dmode_prompt */
  2827. "%s\015", /* dial_str */
  2828. 0, /* dial_rate */
  2829. 1100, /* esc_time */
  2830. 5, /* esc_char, ^E */
  2831. "\003\004", /* hup_str, ^C^D */
  2832. 0, /* hwfc_str */
  2833. "", /* swfc_str */
  2834. "", /* nofc_str */
  2835. "", /* ec_on_str */
  2836. "", /* ec_off_str */
  2837. "", /* dc_on_str */
  2838. "", /* dc_off_str */
  2839. "", /* aa_on_str */
  2840. "", /* aa_off_str */
  2841. "", /* sb_on_str */
  2842. "", /* sb_off_str */
  2843. "", /* sp_off_str */
  2844. "", /* sp_on_str */
  2845. "", /* vol1_str */
  2846. "", /* vol2_str */
  2847. "", /* vol3_str */
  2848. "", /* ignoredt */
  2849. "", /* ini2 */
  2850. 0L, /* max_speed */
  2851. 0, /* capas */
  2852. NULL /* ok_fn */
  2853. };
  2854. static
  2855. MDMINF VENTEL = /* Information for Ven-Tel modem */
  2856. {
  2857. "Ven-Tel",
  2858. "", /* pulse command */
  2859. "", /* tone command */
  2860. 20, /* dial_time */
  2861. "%", /* pause_chars */
  2862. 5, /* pause_time */
  2863. "\015\015\015", /* wake_str */
  2864. 300, /* wake_rate */
  2865. "$", /* wake_prompt */
  2866. "K\015", /* dmode_str (was "") */
  2867. "Number to call: ", /* dmode_prompt (was NULL) */
  2868. "%s\015", /* dial_str (was "<K%s\r>") */
  2869. 0, /* dial_rate */
  2870. 0, /* esc_time */
  2871. 0, /* esc_char */
  2872. "", /* hup_str */
  2873. "", /* hwfc_str */
  2874. "", /* swfc_str */
  2875. "", /* nofc_str */
  2876. "", /* ec_on_str */
  2877. "", /* ec_off_str */
  2878. "", /* dc_on_str */
  2879. "", /* dc_off_str */
  2880. "", /* aa_on_str */
  2881. "", /* aa_off_str */
  2882. "", /* sb_on_str */
  2883. "", /* sb_off_str */
  2884. "", /* sp_off_str */
  2885. "", /* sp_on_str */
  2886. "", /* vol1_str */
  2887. "", /* vol2_str */
  2888. "", /* vol3_str */
  2889. "", /* ignoredt */
  2890. "", /* ini2 */
  2891. 0L, /* max_speed */
  2892. 0, /* capas */
  2893. NULL /* ok_fn */
  2894. };
  2895. static
  2896. MDMINF CONCORD = /* Info for Condor CDS 220 2400b modem */
  2897. {
  2898. "Concord Condor CDS 220 2400b",
  2899. "", /* pulse command */
  2900. "", /* tone command */
  2901. 35, /* dial_time */
  2902. ",", /* pause_chars */
  2903. 2, /* pause_time */
  2904. "\015\015", /* wake_str */
  2905. 20, /* wake_rate */
  2906. "CDS >", /* wake_prompt */
  2907. "", /* dmode_str */
  2908. NULL, /* dmode_prompt */
  2909. "<D M%s\015>", /* dial_str */
  2910. 0, /* dial_rate */
  2911. 0, /* esc_time */
  2912. 0, /* esc_char */
  2913. "", /* hup_str */
  2914. "", /* hwfc_str */
  2915. "", /* swfc_str */
  2916. "", /* nofc_str */
  2917. "", /* ec_on_str */
  2918. "", /* ec_off_str */
  2919. "", /* dc_on_str */
  2920. "", /* dc_off_str */
  2921. "", /* aa_on_str */
  2922. "", /* aa_off_str */
  2923. "", /* sb_on_str */
  2924. "", /* sb_off_str */
  2925. "", /* sp_off_str */
  2926. "", /* sp_on_str */
  2927. "", /* vol1_str */
  2928. "", /* vol2_str */
  2929. "", /* vol3_str */
  2930. "", /* ignoredt */
  2931. "", /* ini2 */
  2932. 2400L, /* max_speed */
  2933. 0, /* capas */
  2934. NULL /* ok_fn */
  2935. };
  2936. #endif /* OLDMODEMS */
  2937. static
  2938. MDMINF MICROCOM = /* Microcom modems in native SX mode */
  2939. /* (long answer only) */
  2940. {
  2941. "Microcom MNP modems in SX command mode",
  2942. "DP\015", /* pulse command */
  2943. "DT\015", /* tone command */
  2944. 35, /* dial_time */
  2945. ",!@", /* pause_chars (! and @ aren't pure pauses) */
  2946. 3, /* pause_time */
  2947. /*
  2948. The following sets 8 bits, no parity, BREAK passthru, and SE0 disables the
  2949. escape character, which is a single character with no guard time, totally
  2950. unsafe, so we have no choice but to disable it. Especially since, by
  2951. default, it is Ctrl-A, which is Kermit's packet-start character. We would
  2952. change it to something else, which would enable "mdmhup()", but the user
  2953. wouldn't know about it. Very bad. Note: SE1 sets it to Ctrl-A, SE2
  2954. sets it to Ctrl-B, etc (1..31 allowed). Also SE/Q sets it to "Q".
  2955. */
  2956. "SE0;S1P4;SBRK5\015", /* wake_str */
  2957. 100, /* wake_rate */
  2958. "!", /* wake_prompt */
  2959. "", /* dmode_str */
  2960. NULL, /* dmode_prompt */
  2961. "D%s\015", /* dial_str - number up to 39 chars */
  2962. 0, /* dial_rate */
  2963. 0, /* esc_time */
  2964. 0, /* esc_char - we can't use this */
  2965. "", /* hup_str - it's "H" but can't use */
  2966. "SF13\015", /* hwfc_str */
  2967. "SF11\015", /* swfc_str */
  2968. "SF10\015", /* nofc_str */
  2969. "BAOFF;SMAUT\015", /* ec_on_str */
  2970. "BAON;SMDIR\015", /* ec_off_str */
  2971. "COMP1\015", /* dc_on_str */
  2972. "COMP0\015", /* dc_off_str */
  2973. "AA", /* aa_on_str */
  2974. "", /* aa_off_str */
  2975. "", /* sb_on_str */
  2976. "", /* sb_off_str */
  2977. "SA2", /* sp_off_str */
  2978. "SA0", /* sp_on_str */
  2979. "", /* vol1_str */
  2980. "", /* vol2_str */
  2981. "", /* vol3_str */
  2982. "", /* ignoredt */
  2983. "", /* ini2 */
  2984. 0L, /* max_speed */
  2985. CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_KS, /* capas */
  2986. getok /* ok_fn */
  2987. };
  2988. static
  2989. MDMINF MICROLINK = /* MicroLink ... */
  2990. { /* 14.4TQ,TL,PC;28.8TQ,TQV;2440T/TR */
  2991. "ELSA MicroLink 14.4, 28.8, 33.6 or 56K", /* ELSA GmbH, Aachen */
  2992. "ATP\015", /* pulse command */
  2993. "ATT\015", /* tone command */
  2994. 35, /* dial_time */
  2995. ",", /* pause_chars */
  2996. 2, /* pause_time */
  2997. #ifdef OS2
  2998. "ATQ0E1V1X4&S0\\D0&C1&D2\\K5\015", /* wake_str */
  2999. #else
  3000. #ifdef VMS
  3001. "ATQ0X4&S1\\K5\015", /* wake_str */
  3002. #else
  3003. "ATQ0X4\\K5\015", /* wake_str */
  3004. #endif /* VMS */
  3005. #endif /* OS2 */
  3006. 0, /* wake_rate */
  3007. "OK\015", /* wake_prompt */
  3008. "", /* dmode_str */
  3009. "", /* dmode_prompt */
  3010. "ATD%s\015", /* dial_str */
  3011. 0, /* dial_rate */
  3012. 1100, /* esc_time */
  3013. 43, /* esc_char */
  3014. "ATQ0H\015", /* hup_str */
  3015. "AT\\Q3\015", /* hwfc_str */
  3016. "AT\\Q1\\X0\015", /* swfc_str */
  3017. "AT\\Q0\015", /* nofc_str */
  3018. "AT\\N3\015", /* ec_on_str */
  3019. "AT\\N0\015", /* ec_off_str */
  3020. "AT%C3\015", /* dc_on_str */
  3021. "AT%C0\015", /* dc_off_str */
  3022. "ATS0=1\015", /* aa_on_str */
  3023. "ATS0=0\015", /* aa_off_str */
  3024. "\\J0", /* sb_on_str (?) */
  3025. "", /* sb_off_str */
  3026. "ATM1\015", /* sp_on_str */
  3027. "ATM0\015", /* sp_off_str */
  3028. "ATL1\015", /* vol1_str */
  3029. "ATL2\015", /* vol2_str */
  3030. "ATL3\015", /* vol3_str */
  3031. "ATX3\015", /* ignoredt */
  3032. "", /* ini2 */
  3033. 57600L, /* max_speed */
  3034. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3035. getok /* ok_fn */
  3036. };
  3037. static
  3038. MDMINF ULINKV250 = /* MicroLink V.250 */
  3039. { /* 56Kflex, V.90; V.250 command set */
  3040. "ELSA MicroLink 56K V.250", /* ELSA GmbH, Aachen */
  3041. "ATP\015", /* pulse command */
  3042. "ATT\015", /* tone command */
  3043. 35, /* dial_time */
  3044. ",", /* pause_chars */
  3045. 2, /* pause_time */
  3046. #ifdef OS2
  3047. /* \D0 = DSR & CTS always on but hwfc overrides on CTS. */
  3048. "ATQ0E1V1X4&S0\\D0&C1&D2\015", /* wake_str */
  3049. #else
  3050. #ifdef VMS
  3051. "ATQ0X4&S1\015", /* wake_str */
  3052. #else
  3053. "ATQ0X4\015", /* wake_str */
  3054. #endif /* VMS */
  3055. #endif /* OS2 */
  3056. 0, /* wake_rate */
  3057. "OK\015", /* wake_prompt */
  3058. "", /* dmode_str */
  3059. "", /* dmode_prompt */
  3060. "ATD%s\015", /* dial_str */
  3061. 0, /* dial_rate */
  3062. 1100, /* esc_time */
  3063. 43, /* esc_char */
  3064. "ATQ0H0\015", /* hup_str */
  3065. "AT+IFC=2,2\015", /* hwfc_str */
  3066. "AT+IFC=1,1\015", /* swfc_str */
  3067. "AT+IFC=0,0\015", /* nofc_str */
  3068. "AT+ES=3,0\015", /* ec_on_str */
  3069. "AT+ES=1,0\015", /* ec_off_str */
  3070. "AT+DS=3,0,2048,32\015", /* dc_on_str */
  3071. "AT+DS=0,0\015", /* dc_off_str */
  3072. "ATS0=1\015", /* aa_on_str */
  3073. "ATS0=0\015", /* aa_off_str */
  3074. "", /* sb_on_str (?) */
  3075. "", /* sb_off_str */
  3076. "ATM1\015", /* sp_on_str */
  3077. "ATM0\015", /* sp_off_str */
  3078. "ATL1\015", /* vol1_str */
  3079. "ATL2\015", /* vol2_str */
  3080. "ATL3\015", /* vol3_str */
  3081. "ATX3\015", /* ignoredt */
  3082. "", /* ini2 */
  3083. 57600L, /* max_speed */
  3084. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3085. getok /* ok_fn */
  3086. };
  3087. #endif /* MINIDIAL */
  3088. static
  3089. MDMINF ITUTV250 = /* ITU-T V.250 conforming modem */
  3090. {
  3091. "Any ITU-T V.25ter/V.250 conformant modem",
  3092. "ATP\015", /* pulse command */
  3093. "ATT\015", /* tone command */
  3094. 35, /* dial_time */
  3095. ",", /* pause_chars */
  3096. 2, /* pause_time */
  3097. "ATQ0E1V1X4&C1&D2\015", /* wake_str (no &Sn in V.25) */
  3098. 0, /* wake_rate */
  3099. "OK\015", /* wake_prompt */
  3100. "", /* dmode_str */
  3101. "", /* dmode_prompt */
  3102. "ATD%s\015", /* dial_str */
  3103. 0, /* dial_rate */
  3104. 1100, /* esc_time */
  3105. 43, /* esc_char */
  3106. "ATQ0H0\015", /* hup_str */
  3107. "AT+IFC=2,2\015", /* hwfc_str */
  3108. "AT+IFC=1,1\015", /* swfc_str */
  3109. "AT+IFC=0,0\015", /* nofc_str */
  3110. "AT+ES=3,0,2;+EB=1,0,30\015", /* ec_on_str */
  3111. "AT+ES=0\015", /* ec_off_str */
  3112. "AT+DS=3,0\015", /* dc_on_str */
  3113. "AT+DS=0,0\015", /* dc_off_str */
  3114. "ATS0=1\015", /* aa_on_str */
  3115. "ATS0=0\015", /* aa_off_str */
  3116. "", /* sb_on_str */
  3117. "", /* sb_off_str */
  3118. "ATM1\015", /* sp_on_str */
  3119. "ATM0\015", /* sp_off_str */
  3120. "ATL1\015", /* vol1_str */
  3121. "ATL2\015", /* vol2_str */
  3122. "ATL3\015", /* vol3_str */
  3123. "ATX3\015", /* ignoredt */
  3124. "", /* ini2 */
  3125. 57600L, /* max_speed */
  3126. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3127. getok /* ok_fn */
  3128. };
  3129. #ifndef CK_TAPI
  3130. static
  3131. #endif /* CK_TAPI */
  3132. MDMINF GENERIC = /* Generic high speed ... */
  3133. {
  3134. "Generic high-speed AT command set",
  3135. "ATP\015", /* pulse command */
  3136. "ATT\015", /* tone command */
  3137. 35, /* dial_time */
  3138. ",", /* pause_chars */
  3139. 2, /* pause_time */
  3140. "", /* wake_str */
  3141. 0, /* wake_rate */
  3142. "", /* wake_prompt */
  3143. "", /* dmode_str */
  3144. "", /* dmode_prompt */
  3145. "ATD%s\015", /* dial_str */
  3146. 0, /* dial_rate */
  3147. 1100, /* esc_time */
  3148. 43, /* esc_char */
  3149. "ATQ0H0\015", /* hup_str */
  3150. "", /* hwfc_str */
  3151. "", /* swfc_str */
  3152. "", /* nofc_str */
  3153. "", /* ec_on_str */
  3154. "", /* ec_off_str */
  3155. "", /* dc_on_str */
  3156. "", /* dc_off_str */
  3157. "ATS0=1\015", /* aa_on_str */
  3158. "ATS0=0\015", /* aa_off_str */
  3159. "", /* sb_on_str */
  3160. "", /* sb_off_str */
  3161. "", /* sp_on_str */
  3162. "", /* sp_off_str */
  3163. "", /* vol1_str */
  3164. "", /* vol2_str */
  3165. "", /* vol3_str */
  3166. "ATX3\015", /* ignoredt */
  3167. "", /* ini2 */
  3168. 115200, /* max_speed */
  3169. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
  3170. getok /* ok_fn */
  3171. };
  3172. #ifndef MINIDIAL
  3173. static
  3174. MDMINF XJACK = /* Megahertz X-Jack */
  3175. {
  3176. "Megahertz X-Jack XJ3144 / CC6144",
  3177. "ATP\015", /* pulse command */
  3178. "ATT\015", /* tone command */
  3179. 35, /* dial_time */
  3180. ",", /* pause_chars */
  3181. 2, /* pause_time */
  3182. #ifdef OS2
  3183. "ATQ0E1V1X4N1&C1&D2\\K5\015", /* wake_str */
  3184. #else
  3185. "ATQ0X4N1\\K5\015", /* wake_str */
  3186. #endif /* OS2 */
  3187. 0, /* wake_rate */
  3188. "OK\015", /* wake_prompt */
  3189. "", /* dmode_str */
  3190. "", /* dmode_prompt */
  3191. "ATD%s\015", /* dial_str */
  3192. 0, /* dial_rate */
  3193. 1100, /* esc_time */
  3194. 43, /* esc_char */
  3195. "ATQ0H\015", /* hup_str */
  3196. "AT&K3\015", /* hwfc_str */
  3197. "AT&K4\015", /* swfc_str */
  3198. "AT&K0\015", /* nofc_str */
  3199. "AT\\N3&Q5\015", /* ec_on_str */
  3200. "AT\\N1&Q0\015", /* ec_off_str */
  3201. "AT%C3\015", /* dc_on_str */
  3202. "AT%C0\015", /* dc_off_str */
  3203. "ATS0=1\015", /* aa_on_str */
  3204. "ATS0=0\015", /* aa_off_str */
  3205. "", /* sb_on_str */
  3206. "", /* sb_off_str */
  3207. "ATM1\015", /* sp_on_str */
  3208. "ATM0\015", /* sp_off_str */
  3209. "ATL1\015", /* vol1_str */
  3210. "ATL2\015", /* vol2_str */
  3211. "ATL3\015", /* vol3_str */
  3212. "ATX3\015", /* ignoredt */
  3213. "", /* ini2 */
  3214. 57600L, /* max_speed */
  3215. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3216. getok /* ok_fn */
  3217. };
  3218. static
  3219. MDMINF SPIRITII = /* QuickComm Spirit II */
  3220. {
  3221. "QuickComm Spirit II",
  3222. "ATP\015", /* pulse command */
  3223. "ATT\015", /* tone command */
  3224. 35, /* dial_time */
  3225. ",", /* pause_chars */
  3226. 2, /* pause_time */
  3227. "AT&F\015", /* wake_str */
  3228. 0, /* wake_rate */
  3229. "OK\015", /* wake_prompt */
  3230. "", /* dmode_str */
  3231. "", /* dmode_prompt */
  3232. "ATD%s\015", /* dial_str */
  3233. 0, /* dial_rate */
  3234. 1100, /* esc_time */
  3235. 43, /* esc_char */
  3236. "ATQ0H\015", /* hup_str */
  3237. "AT*F3\015", /* hwfc_str */
  3238. "AT*F2\015", /* swfc_str */
  3239. "AT*F0\015", /* nofc_str */
  3240. "AT*E6\015", /* ec_on_str */
  3241. "AT*E0\015", /* ec_off_str */
  3242. "AT*E9\015", /* dc_on_str */
  3243. "AT*E0\015", /* dc_off_str */
  3244. "ATS0=2\015", /* aa_on_str */
  3245. "ATS0=0\015", /* aa_off_str */
  3246. "", /* sb_on_str */
  3247. "", /* sb_off_str */
  3248. "ATM1\015", /* sp_on_str */
  3249. "ATM0\015", /* sp_off_str */
  3250. "ATL1\015", /* vol1_str */
  3251. "ATL2\015", /* vol2_str */
  3252. "ATL3\015", /* vol3_str */
  3253. "ATX3\015", /* ignoredt */
  3254. "", /* ini2 */
  3255. 57600L, /* max_speed */
  3256. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3257. getok /* ok_fn */
  3258. };
  3259. static
  3260. MDMINF MONTANA = { /* Motorola Montana */
  3261. "Motorola Montana", /* Name */
  3262. "ATP\015", /* pulse command */
  3263. "ATT\015", /* tone command */
  3264. 35, /* dial_time */
  3265. ",", /* pause_chars */
  3266. 2, /* pause_time */
  3267. #ifdef OS2
  3268. "ATQ0E1V1X4&S0&C1&D2\\K5\\V1\015", /* wake_str */
  3269. #else
  3270. #ifdef VMS
  3271. "ATQ0E1X4&S1\\K5\\V1\015", /* wake_str */
  3272. #else
  3273. "ATQ0E1X4\\K5\\V1\015", /* wake_str */
  3274. #endif /* VMS */
  3275. #endif /* OS2 */
  3276. 0, /* wake_rate */
  3277. "OK\015", /* wake_prompt */
  3278. "", /* dmode_str */
  3279. "", /* dmode_prompt */
  3280. "ATD%s\015", /* dial_str */
  3281. 0, /* dial_rate */
  3282. 1100, /* esc_time */
  3283. 43, /* esc_char */
  3284. "ATQ0H0\015", /* hup_str */
  3285. "AT\\Q3\015", /* hwfc_str */
  3286. "AT\\Q1\015", /* swfc_str */
  3287. "AT\\Q0\015", /* nofc_str */
  3288. "AT\\N4\015", /* ec_on_str */
  3289. "AT\\N1\015", /* ec_off_str */
  3290. "AT%C1\015", /* dc_on_str */
  3291. "AT%C0\015", /* dc_off_str */
  3292. "ATS0=1\015", /* aa_on_str */
  3293. "ATS0=0\015", /* aa_off_str */
  3294. "AT\\J0\015", /* sb_on_str */
  3295. "AT\\J1\015", /* sb_off_str */
  3296. "ATM1\015", /* sp_on_str */
  3297. "ATM0\015", /* sp_off_str */
  3298. "ATL1\015", /* vol1_str */
  3299. "ATL2\015", /* vol2_str */
  3300. "ATL3\015", /* vol3_str */
  3301. "ATX3\015", /* ignoredt */
  3302. "", /* ini2 */
  3303. 57600L, /* max_speed */
  3304. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3305. getok /* ok_fn */
  3306. };
  3307. static
  3308. MDMINF COMPAQ = { /* Compaq Data+Fax Modem */
  3309. "Compaq Data+Fax Modem", /* Name */
  3310. "ATP\015", /* pulse command */
  3311. "ATT\015", /* tone command */
  3312. 35, /* dial_time */
  3313. ",", /* pause_chars */
  3314. 2, /* pause_time */
  3315. #ifdef OS2
  3316. "ATQ0E1V1X4&S0&C1&D2\015", /* wake_str */
  3317. #else
  3318. #ifdef VMS
  3319. "ATQ0E1X4&S1\015", /* wake_str */
  3320. #else
  3321. "ATQ0E1X4\015", /* wake_str */
  3322. #endif /* VMS */
  3323. #endif /* OS2 */
  3324. 0, /* wake_rate */
  3325. "OK\015", /* wake_prompt */
  3326. "", /* dmode_str */
  3327. "", /* dmode_prompt */
  3328. "ATD%s\015", /* dial_str */
  3329. 0, /* dial_rate */
  3330. 1100, /* esc_time */
  3331. 43, /* esc_char */
  3332. "ATQ0H0\015", /* hup_str */
  3333. "AT\\Q3\015", /* hwfc_str (same as &K3) */
  3334. "AT\\Q1\015", /* swfc_str (same as &K4) */
  3335. "AT\\Q0\015", /* nofc_str (same as &K0) */
  3336. "AT\\N3\015", /* ec_on_str */
  3337. "AT\\N0\015", /* ec_off_str */
  3338. "AT%C1\015", /* dc_on_str */
  3339. "AT%C0\015", /* dc_off_str */
  3340. "ATS0=1\015", /* aa_on_str */
  3341. "ATS0=0\015", /* aa_off_str */
  3342. "AT\\N3\015", /* sb_on_str */
  3343. "AT\\N1\015", /* sb_off_str */
  3344. "ATM1\015", /* sp_on_str */
  3345. "ATM0\015", /* sp_off_str */
  3346. "ATL0\015", /* vol1_str */
  3347. "ATL2\015", /* vol2_str */
  3348. "ATL3\015", /* vol3_str */
  3349. "ATX3\015", /* ignoredt */
  3350. "", /* ini2 */
  3351. 115200L, /* max_speed */
  3352. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3353. getok /* ok_fn */
  3354. };
  3355. static
  3356. MDMINF FUJITSU = { /* Fujitsu */
  3357. "Fujitsu Fax/Modem Adapter", /* Name */
  3358. "ATP\015", /* pulse command */
  3359. "ATT\015", /* tone command */
  3360. 35, /* dial_time */
  3361. ",", /* pause_chars */
  3362. 2, /* pause_time */
  3363. #ifdef OS2
  3364. "ATQ0E1V1X4&S0&C1&D2\\K5\\N3\015", /* wake_str */
  3365. #else
  3366. #ifdef VMS
  3367. "ATQ0E1X4&S1\\K5\\N3\015", /* wake_str */
  3368. #else
  3369. "ATQ0E1X4\\K5\\N3\015", /* wake_str */
  3370. #endif /* VMS */
  3371. #endif /* OS2 */
  3372. 0, /* wake_rate */
  3373. "OK\015", /* wake_prompt */
  3374. "", /* dmode_str */
  3375. "", /* dmode_prompt */
  3376. "ATD%s\015", /* dial_str */
  3377. 0, /* dial_rate */
  3378. 1100, /* esc_time */
  3379. 43, /* esc_char */
  3380. "ATQ0H0\015", /* hup_str */
  3381. "AT&K3\\Q3\015", /* hwfc_str */
  3382. "AT&K4\\Q1\015", /* swfc_str */
  3383. "AT&K0\\Q0\015", /* nofc_str */
  3384. "AT\\N3\015", /* ec_on_str */
  3385. "AT\\N0\015", /* ec_off_str */
  3386. "AT%C1", /* dc_on_str */
  3387. "AT%C0", /* dc_off_str */
  3388. "ATS0=1\015", /* aa_on_str */
  3389. "ATS0=0\015", /* aa_off_str */
  3390. "AT\\J0\015", /* sb_on_str */
  3391. "AT\\J1\015", /* sb_off_str */
  3392. "ATM1\015", /* sp_on_str */
  3393. "ATM0\015", /* sp_off_str */
  3394. "ATL1\015", /* vol1_str */
  3395. "ATL2\015", /* vol2_str */
  3396. "ATL3\015", /* vol3_str */
  3397. "ATX3\015", /* ignoredt */
  3398. "", /* ini2 */
  3399. 115200L, /* max_speed */
  3400. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3401. getok /* ok_fn */
  3402. };
  3403. static
  3404. MDMINF MHZATT = /* Megahertz AT&T V.34 */
  3405. {
  3406. "Megahertz AT&T V.34",
  3407. "ATP\015", /* pulse command */
  3408. "ATT\015", /* tone command */
  3409. 35, /* dial_time */
  3410. ",", /* pause_chars */
  3411. 2, /* pause_time */
  3412. #ifdef OS2
  3413. "ATQ0E1V1X4N1&C1&D2\\K5\015", /* wake_str */
  3414. #else
  3415. "ATQ0X4N1\\K5\015", /* wake_str */
  3416. #endif /* OS2 */
  3417. 0, /* wake_rate */
  3418. "OK\015", /* wake_prompt */
  3419. "", /* dmode_str */
  3420. "", /* dmode_prompt */
  3421. "ATD%s\015", /* dial_str */
  3422. 0, /* dial_rate */
  3423. 1100, /* esc_time */
  3424. 43, /* esc_char */
  3425. "ATQ0H\015", /* hup_str */
  3426. "AT&K3\015", /* hwfc_str */
  3427. "AT&K4\015", /* swfc_str */
  3428. "AT&K0\015", /* nofc_str */
  3429. "AT\\N3\015", /* ec_on_str */
  3430. "AT\\N0\015", /* ec_off_str */
  3431. "AT%C1\"H3\015", /* dc_on_str */
  3432. "AT%C0\"H0\015", /* dc_off_str */
  3433. "ATS0=1\015", /* aa_on_str */
  3434. "ATS0=0\015", /* aa_off_str */
  3435. "AT\\J0\015", /* sb_on_str */
  3436. "AT\\J1\015", /* sb_off_str */
  3437. "ATM1\015", /* sp_on_str */
  3438. "ATM0\015", /* sp_off_str */
  3439. "ATL1\015", /* vol1_str */
  3440. "ATL2\015", /* vol2_str */
  3441. "ATL3\015", /* vol3_str */
  3442. "ATX3\015", /* ignoredt */
  3443. "", /* ini2 */
  3444. 115200L, /* max_speed */
  3445. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3446. getok /* ok_fn */
  3447. };
  3448. static
  3449. MDMINF SUPRASON = /* SupraSonic */
  3450. {
  3451. "Diamond SupraSonic 288V+", /* Diamond Multimedia Systems Inc */
  3452. "ATP\015", /* pulse command */
  3453. "ATT\015", /* tone command */
  3454. 35, /* dial_time */
  3455. ",", /* pause_chars */
  3456. 2, /* pause_time */
  3457. #ifdef OS2
  3458. "ATQ0E1V1N1W0X4Y0&S0&C1&D2\015", /* wake_str */
  3459. #else
  3460. #ifdef VMS
  3461. "ATQ0E1N1W0X4Y0&S1\015", /* wake_str */
  3462. #else
  3463. "ATQ0E1N1W0X4Y0\015", /* wake_str */
  3464. #endif /* VMS */
  3465. #endif /* OS2 */
  3466. 0, /* wake_rate */
  3467. "OK\015", /* wake_prompt */
  3468. "", /* dmode_str */
  3469. "", /* dmode_prompt */
  3470. "ATD%s\015", /* dial_str */
  3471. 0, /* dial_rate */
  3472. 1100, /* esc_time */
  3473. 43, /* esc_char */
  3474. "ATQ0H0\015", /* hup_str */
  3475. "AT&K3\015", /* hwfc_str */
  3476. "AT&K4\015", /* swfc_str */
  3477. "AT&K\015", /* nofc_str */
  3478. "AT&Q5\\N3S48=7\015", /* ec_on_str */
  3479. "AT&Q0\\N1\015", /* ec_off_str */
  3480. "AT%C3S46=138\015", /* dc_on_str */
  3481. "AT%C0S46=136\015", /* dc_off_str */
  3482. "ATS0=1\015", /* aa_on_str */
  3483. "ATS0=0\015", /* aa_off_str */
  3484. "", /* sb_on_str */
  3485. "", /* sb_off_str */
  3486. "ATM1\015", /* sp_on_str */
  3487. "ATM\015", /* sp_off_str */
  3488. "ATL\015", /* vol1_str */
  3489. "ATL2\015", /* vol2_str */
  3490. "ATL3\015", /* vol3_str */
  3491. "ATX3\015", /* ignoredt */
  3492. "", /* ini2 */
  3493. 115200L, /* max_speed */
  3494. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3495. getok /* ok_fn */
  3496. };
  3497. static
  3498. MDMINF BESTDATA = /* Best Data */
  3499. {
  3500. "Best Data Fax Modem", /* Best Data Fax Modem */
  3501. "ATP\015", /* pulse command */
  3502. "ATT\015", /* tone command */
  3503. 35, /* dial_time */
  3504. ",", /* pause_chars */
  3505. 2, /* pause_time */
  3506. #ifdef OS2
  3507. "ATQ0E1V1N1W0X4Y0&S0&C1&D2\015", /* wake_str */
  3508. #else
  3509. #ifdef VMS
  3510. "ATQ0E1N1W0X4Y0&S1\015", /* wake_str */
  3511. #else
  3512. "ATQ0E1N1W0X4Y0\015", /* wake_str */
  3513. #endif /* VMS */
  3514. #endif /* OS2 */
  3515. 0, /* wake_rate */
  3516. "OK\015", /* wake_prompt */
  3517. "", /* dmode_str */
  3518. "", /* dmode_prompt */
  3519. "ATD%s\015", /* dial_str */
  3520. 0, /* dial_rate */
  3521. 1100, /* esc_time */
  3522. 43, /* esc_char */
  3523. "ATQ0H0\015", /* hup_str */
  3524. "AT&K3\015", /* hwfc_str */
  3525. "AT&K4\015", /* swfc_str */
  3526. "AT&K\015", /* nofc_str */
  3527. "AT&Q6\\N3\015", /* ec_on_str */
  3528. "AT&Q0\\N1\015", /* ec_off_str */
  3529. "AT%C3\015", /* dc_on_str */
  3530. "AT%C0\015", /* dc_off_str */
  3531. "ATS0=1\015", /* aa_on_str */
  3532. "ATS0=0\015", /* aa_off_str */
  3533. "AT\\N3\015", /* sb_on_str */
  3534. "AT\\N0\015", /* sb_off_str */
  3535. "ATM1\015", /* sp_on_str */
  3536. "ATM0\015", /* sp_off_str */
  3537. "ATL1\015", /* vol1_str */
  3538. "ATL2\015", /* vol2_str */
  3539. "ATL3\015", /* vol3_str */
  3540. "ATX3\015", /* ignoredt */
  3541. "", /* ini2 */
  3542. 57600L, /* max_speed */
  3543. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3544. getok /* ok_fn */
  3545. };
  3546. static
  3547. MDMINF ATT1900 = /* AT&T Secure Data STU III 1900 */
  3548. {
  3549. "AT&T Secure Data STU III Model 1900", /* name */
  3550. "", /* pulse command */
  3551. "", /* tone command */
  3552. 35, /* dial_time */
  3553. ",", /* pause_chars */
  3554. 2, /* pause_time */
  3555. #ifdef OS2
  3556. "ATQ0E1V1X4\015", /* wake_str */
  3557. #else
  3558. "ATQ0E1X4\015", /* wake_str */
  3559. #endif /* OS2 */
  3560. 0, /* wake_rate */
  3561. "OK\015", /* wake_prompt */
  3562. "", /* dmode_str */
  3563. "", /* dmode_prompt */
  3564. "ATD%s\015", /* dial_str */
  3565. 0, /* dial_rate */
  3566. 1100, /* esc_time */
  3567. 43, /* esc_char */
  3568. "ATQ0H0\015", /* hup_str */
  3569. "", /* hwfc_str */
  3570. "", /* swfc_str */
  3571. "", /* nofc_str */
  3572. "", /* ec_on_str */
  3573. "", /* ec_off_str */
  3574. "", /* dc_on_str */
  3575. "", /* dc_off_str */
  3576. "ATS0=1\015", /* aa_on_str */
  3577. "ATS0=0\015", /* aa_off_str */
  3578. "", /* sb_on_str */
  3579. "", /* sb_off_str */
  3580. "", /* sp_on_str */
  3581. "", /* sp_off_str */
  3582. "", /* vol1_str */
  3583. "", /* vol2_str */
  3584. "", /* vol3_str */
  3585. "", /* ignoredt */
  3586. "", /* ini2 */
  3587. 9600L, /* max_speed */
  3588. CKD_AT|CKD_SB|CKD_HW, /* capas */
  3589. getok /* ok_fn */
  3590. };
  3591. /*
  3592. Experimentation showed that hardly any of the documented commands did
  3593. anything other that print ERROR. At first there was no communication at
  3594. all at 9600 bps -- turns out the interface speed was stuck at 2400.
  3595. ATS28=130 (given at 2400 bps) allowed it to work at 9600.
  3596. */
  3597. static
  3598. MDMINF ATT1910 = /* AT&T Secure Data STU III 1910 */
  3599. { /* Adds V.32bis, V.42, V.42bis */
  3600. "AT&T Secure Data STU III Model 1910", /* name */
  3601. /* Believe it or not, "ATT" and "ATP" result in ERROR */
  3602. "", /* pulse command */
  3603. "", /* tone command */
  3604. 35, /* dial_time */
  3605. ",", /* pause_chars */
  3606. 2, /* pause_time */
  3607. #ifdef OS2
  3608. "ATQ0E1V1X4\015", /* wake_str */
  3609. #else
  3610. "ATQ0E1X4\015", /* wake_str */
  3611. #endif /* OS2 */
  3612. 0, /* wake_rate */
  3613. "OK\015", /* wake_prompt */
  3614. "", /* dmode_str */
  3615. "", /* dmode_prompt */
  3616. "ATD%s\015", /* dial_str */
  3617. 0, /* dial_rate */
  3618. 1100, /* esc_time */
  3619. 43, /* esc_char */
  3620. "ATQ0H0\015", /* hup_str */
  3621. "", /* hwfc_str */
  3622. "", /* swfc_str */
  3623. "", /* nofc_str */
  3624. #ifdef COMMENT
  3625. /* These are evidently read-only registers */
  3626. "ATS46=138S47=0\015", /* ec_on_str */
  3627. "ATS46=138S47=128\015", /* ec_off_str */
  3628. "ATS46=138S47=0\015", /* dc_on_str */
  3629. "ATS46=138S47=128\015", /* dc_off_str */
  3630. #else
  3631. "",
  3632. "",
  3633. "",
  3634. "",
  3635. #endif /* COMMENT */
  3636. "ATS0=1\015", /* aa_on_str */
  3637. "ATS0=0\015", /* aa_off_str */
  3638. "", /* sb_on_str */
  3639. "", /* sb_off_str */
  3640. "", /* sp_on_str */
  3641. "", /* sp_off_str */
  3642. "", /* vol1_str */
  3643. "", /* vol2_str */
  3644. "", /* vol3_str */
  3645. "", /* ignoredt */
  3646. "", /* ini2 */
  3647. 9600L, /* max_speed */
  3648. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
  3649. getok /* ok_fn */
  3650. };
  3651. static
  3652. MDMINF KEEPINTOUCH = /* AT&T KeepinTouch Card Modem */
  3653. {
  3654. "AT&T KeepinTouch V.32bis Card Modem", /* Name */
  3655. "ATP\015", /* pulse command */
  3656. "ATT\015", /* tone command */
  3657. 35, /* dial_time */
  3658. ",", /* pause_chars */
  3659. 2, /* pause_time */
  3660. #ifdef OS2
  3661. /* This used to include &C1&S0&D2+Q0 but that gives ERROR */
  3662. "ATQ0E1V1X4&S0&C1&D2\\K5\015", /* wake_str */
  3663. #else
  3664. #ifdef VMS
  3665. "ATQ0E1X4&S1\\K5\015", /* wake_str */
  3666. #else
  3667. "ATQ0E1X4\\K5\015", /* wake_str */
  3668. #endif /* VMS */
  3669. #endif /* OS2 */
  3670. 0, /* wake_rate */
  3671. "OK\015", /* wake_prompt */
  3672. "", /* dmode_str */
  3673. "", /* dmode_prompt */
  3674. "ATD%s\015", /* dial_str */
  3675. 0, /* dial_rate */
  3676. 1100, /* esc_time */
  3677. 43, /* esc_char */
  3678. "ATQ0H0\015", /* hup_str */
  3679. "AT\\Q3\015", /* hwfc_str */
  3680. "AT\\Q1\\X0\015", /* swfc_str */
  3681. "AT\\Q0\015", /* nofc_str */
  3682. "AT\\N3-J1\015", /* ec_on_str */
  3683. "AT\\N1\015", /* ec_off_str */
  3684. "AT%C3\"H3\015", /* dc_on_str */
  3685. "AT%C0\"H0\015", /* dc_off_str */
  3686. "ATS0=1\015", /* aa_on_str */
  3687. "ATS0=0\015", /* aa_off_str */
  3688. "ATN0\\J0\015", /* sb_on_str */
  3689. "ATN1\\J1\015", /* sb_off_str */
  3690. "ATM1\015", /* sp_on_str */
  3691. "ATM0\015", /* sp_off_str */
  3692. "", /* vol1_str */
  3693. "", /* vol2_str */
  3694. "", /* vol3_str */
  3695. "ATX3\015", /* ignoredt */
  3696. "", /* ini2 */
  3697. 57600L, /* max_speed */
  3698. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3699. getok /* ok_fn */
  3700. };
  3701. static
  3702. MDMINF ROLM_AT = /* Rolm data phone with AT command set */
  3703. {
  3704. "Rolm 244PC or 600 Series with AT Command Set",
  3705. "", /* pulse command */
  3706. "", /* tone command */
  3707. 35, /* dial_time */
  3708. ",", /* pause_chars */
  3709. 2, /* pause_time */
  3710. #ifdef OS2
  3711. "ATE1Q0V1\015", /* wake_str */
  3712. #else
  3713. "ATQ0\015", /* wake_str */
  3714. #endif /* OS2 */
  3715. 0, /* wake_rate */
  3716. "OK\015", /* wake_prompt */
  3717. "", /* dmode_str */
  3718. "", /* dmode_prompt */
  3719. "ATDT%s\015", /* dial_str -- always Tone */
  3720. 0, /* dial_rate */
  3721. 1100, /* esc_time */
  3722. 43, /* esc_char */
  3723. "ATQ0H0\015", /* hup_str */
  3724. "", /* hwfc_str */
  3725. "", /* swfc_str */
  3726. "", /* nofc_str */
  3727. "", /* ec_on_str */
  3728. "", /* ec_off_str */
  3729. "", /* dc_on_str */
  3730. "", /* dc_off_str */
  3731. "ATS0=1\015", /* aa_on_str */
  3732. "ATS0=0\015", /* aa_off_str */
  3733. "", /* sb_on_str */
  3734. "", /* sb_off_str */
  3735. "", /* sp_on_str */
  3736. "", /* sp_off_str */
  3737. "", /* vol1_str */
  3738. "", /* vol2_str */
  3739. "", /* vol3_str */
  3740. "", /* ignoredt */
  3741. "", /* ini2 */
  3742. 19200L, /* max_speed */
  3743. CKD_AT, /* capas */
  3744. getok /* ok_fn */
  3745. };
  3746. static
  3747. MDMINF ATLAS = /* Atlas / Newcom ixfC 33.6 */
  3748. {
  3749. "Atlas / Newcom 33600ixfC Data/Fax Modem", /* Name */
  3750. "ATP\015", /* pulse command */
  3751. "ATT\015", /* tone command */
  3752. 35, /* dial_time */
  3753. ",", /* pause_chars */
  3754. 2, /* pause_time */
  3755. #ifdef OS2
  3756. "ATZ0&FQ0V1&C1&D2\015", /* wake_str */
  3757. #else
  3758. "ATZ0&FQ0V1\015", /* wake_str */
  3759. #endif /* OS2 */
  3760. 0, /* wake_rate */
  3761. "OK\015", /* wake_prompt */
  3762. "", /* dmode_str */
  3763. "", /* dmode_prompt */
  3764. "ATD%s\015", /* dial_str */
  3765. 0, /* dial_rate */
  3766. 1100, /* esc_time */
  3767. 43, /* esc_char */
  3768. "ATQ0H0\015", /* hup_str */
  3769. "AT&K3\015", /* hwfc_str */
  3770. "AT&K4\015", /* swfc_str */
  3771. "AT&K0\015", /* nofc_str */
  3772. "AT\"H3\015", /* ec_on_str */
  3773. "AT\"H0\015", /* ec_off_str */
  3774. "AT%C1\015", /* dc_on_str */
  3775. "AT%C0\015", /* dc_off_str */
  3776. "ATS0=1\015", /* aa_on_str */
  3777. "ATS0=0\015", /* aa_off_str */
  3778. "ATN0\\J0\015", /* sb_on_str */
  3779. "ATN1\\J1\015", /* sb_off_str */
  3780. "ATM1\015", /* sp_on_str */
  3781. "ATM0\015", /* sp_off_str */
  3782. "ATL1\015", /* vol1_str */
  3783. "ATL2\015", /* vol2_str */
  3784. "ATL3\015", /* vol3_str */
  3785. "ATX3\015", /* ignoredt */
  3786. "", /* ini2 */
  3787. 115200L, /* max_speed */
  3788. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3789. getok /* ok_fn */
  3790. };
  3791. static
  3792. MDMINF CODEX = { /* Motorola Codex */
  3793. "Motorola Codex 326X Series", /* Name - AT&V to see settings */
  3794. "ATP\015", /* pulse command */
  3795. "ATT\015", /* tone command */
  3796. 35, /* dial_time */
  3797. ",", /* pause_chars */
  3798. 2, /* pause_time */
  3799. #ifdef OS2
  3800. /* &M0=Async (not sync) */
  3801. /* *MM0=Automatic modulation negotiation */
  3802. /* *DE22=Automatic data rate */
  3803. "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0&S0&D2\015", /* wake_str */
  3804. #else
  3805. #ifdef VMS
  3806. "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0&S1\015", /* wake_str */
  3807. #else
  3808. "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0\015", /* wake_str */
  3809. #endif /* VMS */
  3810. #endif /* OS2 */
  3811. 0, /* wake_rate */
  3812. "OK\015", /* wake_prompt */
  3813. "", /* dmode_str */
  3814. "", /* dmode_prompt */
  3815. "ATD%s\015", /* dial_str */
  3816. 0, /* dial_rate */
  3817. 1100, /* esc_time */
  3818. 43, /* esc_char */
  3819. "ATQ0H0\015", /* hup_str */
  3820. "AT*MF1*FL3\015", /* hwfc_str */
  3821. "AT*MF1*FL1\015", /* swfc_str */
  3822. "AT*MF0*FL0\015", /* nofc_str */
  3823. "AT*EC0*SM3*SC0\015", /* ec_on_str */
  3824. "AT*SM0\015", /* ec_off_str */
  3825. "AT*DC1\015", /* dc_on_str */
  3826. "AT*DC0\015", /* dc_off_str */
  3827. "AT*AA5S0=1\015", /* aa_on_str */
  3828. "AT*AA5S0=0\015", /* aa_off_str */
  3829. "AT*SC1\015", /* sb_on_str */
  3830. "AT*SC0\015", /* sb_off_str */
  3831. "ATM1\015", /* sp_on_str */
  3832. "ATM0\015", /* sp_off_str */
  3833. "ATL1\015", /* vol1_str */
  3834. "ATL2\015", /* vol2_str */
  3835. "ATL3\015", /* vol3_str */
  3836. "ATX3*BD2\015", /* ignoredt */
  3837. "", /* ini2 */
  3838. 115200L, /* max_speed */
  3839. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3840. getok /* ok_fn */
  3841. };
  3842. static
  3843. MDMINF MT5634ZPX = /* Multitech */
  3844. {
  3845. "Multitech MT5634ZPX", /* name */
  3846. "ATP\015", /* pulse command */
  3847. "ATT\015", /* tone command */
  3848. 35, /* dial_time */
  3849. ",", /* pause_chars */
  3850. 2, /* pause_time */
  3851. #ifdef OS2
  3852. "ATE1Q0V1X4&S0&C1&D2&Q0\015", /* wake_str */
  3853. #else
  3854. #ifdef VMS
  3855. "ATQ0E1X4&S1&Q0\015", /* wake_str */
  3856. #else
  3857. "ATQ0E1X4&Q0\015", /* wake_str */
  3858. #endif /* VMS */
  3859. #endif /* OS2 */
  3860. 0, /* wake_rate */
  3861. "OK\015", /* wake_prompt */
  3862. "", /* dmode_str */
  3863. "", /* dmode_prompt */
  3864. "ATD%s\015", /* dial_str */
  3865. 0, /* dial_rate */
  3866. 1100, /* esc_time */
  3867. 43, /* esc_char */
  3868. "ATQ0H0\015", /* hup_str */
  3869. "AT&K3\015", /* hwfc_str */
  3870. "AT&K4\015", /* swfc_str */
  3871. "AT&K0\015", /* nofc_str */
  3872. "AT\\N3\015", /* ec_on_str */
  3873. "AT\\N1\015", /* ec_off_str */
  3874. "AT%C1\015", /* dc_on_str */
  3875. "AT%C0\015", /* dc_off_str */
  3876. "ATS0=1\015", /* aa_on_str */
  3877. "ATS0=0\015", /* aa_off_str */
  3878. "AT\\J0\015", /* sb_on_str */
  3879. "AT\\J1\015", /* sb_off_str (NOT SUPPORTED) */
  3880. "ATM1\015", /* sp_on_str */
  3881. "ATM0\015", /* sp_off_str */
  3882. "ATL1\015", /* vol1_str */
  3883. "ATL2\015", /* vol2_str */
  3884. "ATL3\015", /* vol3_str */
  3885. "ATX3\015", /* ignoredt */
  3886. "", /* ini2 */
  3887. 115200L, /* max_speed */
  3888. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3889. getok /* ok_fn */
  3890. };
  3891. static
  3892. MDMINF MOTSM56 = /* Motorola SM56 Chipset */
  3893. {
  3894. "Motorola SM56 V.90 chipset", /* name */
  3895. "ATP\015", /* pulse command */
  3896. "ATT\015", /* tone command */
  3897. 35, /* dial_time */
  3898. ",", /* pause_chars */
  3899. 2, /* pause_time */
  3900. #ifdef OS2
  3901. "ATQ0V1X4&S0&C1&D2*MM16\015", /* wake_str */
  3902. #else
  3903. #ifdef VMS
  3904. "ATQ0V1X4&S1&C1&D2*MM16\015", /* wake_str */
  3905. #else
  3906. "ATQ0V1X4&C1&D2*MM16\015", /* wake_str */
  3907. #endif /* VMS */
  3908. #endif /* OS2 */
  3909. 0, /* wake_rate */
  3910. "OK\015", /* wake_prompt */
  3911. "", /* dmode_str */
  3912. "", /* dmode_prompt */
  3913. "ATD%s\015", /* dial_str */
  3914. 0, /* dial_rate */
  3915. 1100, /* esc_time */
  3916. 43, /* esc_char */
  3917. "ATQ0H0\015", /* hup_str */
  3918. "AT\\Q3\015", /* hwfc_str */
  3919. "AT\\Q1\015", /* swfc_str */
  3920. "AT\\Q0\015", /* nofc_str */
  3921. "AT\\N7\015", /* ec_on_str */
  3922. "AT\\N1\015", /* ec_off_str */
  3923. "AT%C1\015", /* dc_on_str */
  3924. "AT%C0\015", /* dc_off_str */
  3925. "ATS0=1\015", /* aa_on_str */
  3926. "ATS0=0\015", /* aa_off_str */
  3927. "AT\\J0\015", /* sb_on_str */
  3928. "AT\\J1\015", /* sb_off_str (NOT SUPPORTED) */
  3929. "ATM1\015", /* sp_on_str */
  3930. "ATM0\015", /* sp_off_str */
  3931. "ATL1\015", /* vol1_str */
  3932. "ATL2\015", /* vol2_str */
  3933. "ATL3\015", /* vol3_str */
  3934. "ATX3\015", /* ignoredt */
  3935. "", /* ini2 */
  3936. 115200L, /* max_speed */
  3937. CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
  3938. getok /* ok_fn */
  3939. };
  3940. #endif /* MINIDIAL */
  3941. /* END MDMINF STRUCT DEFINITIONS */
  3942. /*
  3943. Table to convert modem numbers to MDMINF struct pointers.
  3944. The entries MUST be in ascending order by modem number, without any
  3945. "gaps" in the numbers, and starting from one (1).
  3946. */
  3947. MDMINF *modemp[] = {
  3948. #ifdef MINIDIAL
  3949. NULL, /* 0 */
  3950. &CCITT, /* 1 */
  3951. &HAYES, /* 2 */
  3952. &UNKNOWN, /* 3 */
  3953. &DUMMY, /* 4 */
  3954. &GENERIC, /* 5 */
  3955. &ITUTV250 /* 6 */
  3956. #else /* Not MINIDIAL */
  3957. NULL, /* 0 */
  3958. &ATTDTDM, /* 1 */
  3959. &ATTISN, /* 2 */
  3960. &ATTMODEM, /* 3 */
  3961. &CCITT, /* 4 */
  3962. #ifdef OLDMODEMS
  3963. &CERMETEK, /* 5 */
  3964. &DF03, /* 6 */
  3965. &DF100, /* 7 */
  3966. &DF200, /* 8 */
  3967. &GDC, /* 9 */
  3968. #else
  3969. NULL,
  3970. NULL,
  3971. NULL,
  3972. NULL,
  3973. NULL,
  3974. #endif /* OLDMODEMS */
  3975. &HAYES, /* 10 */
  3976. #ifdef OLDMODEMS
  3977. &PENRIL, /* 11 */
  3978. &RACAL, /* 12 */
  3979. #else
  3980. NULL,
  3981. NULL,
  3982. #endif /* OLDMODEMS */
  3983. &UNKNOWN, /* 13 */
  3984. #ifdef OLDMODEMS
  3985. &VENTEL, /* 14 */
  3986. &CONCORD, /* 15 */
  3987. #else
  3988. NULL,
  3989. NULL,
  3990. #endif /* OLDMODEMS */
  3991. &DUMMY, /* 16 */
  3992. &ROLM, /* 17 */
  3993. #ifdef OLDMODEMS
  3994. &MICROCOM, /* 18 */
  3995. #else
  3996. NULL,
  3997. #endif /* OLDMODEMS */
  3998. &USR, /* 19 USR Courier and Sportster */
  3999. &OLDTB, /* 20 Old Telebits */
  4000. &DIGITEL, /* 21 Digitel CCITT */
  4001. &H_1200, /* 22 Hayes 1200 */
  4002. &H_ULTRA, /* 23 Hayes Ultra */
  4003. &H_ACCURA, /* 24 Hayes Optima */
  4004. &PPI, /* 25 PPI */
  4005. &DATAPORT, /* 26 Dataport */
  4006. &BOCA, /* 27 Boca */
  4007. &MOTOROLA, /* 28 Motorola UDS MOTOROLA */
  4008. NULL, /* 29 Digicomm */
  4009. NULL, /* 30 Dynalink */
  4010. &INTEL, /* 31 Intel */
  4011. &UCOM_AT, /* 32 Microcom in AT mode */
  4012. &MULTITECH, /* 33 Multitech */
  4013. &SUPRA, /* 34 Supra */
  4014. &ZOLTRIX, /* 35 Zoltrix */
  4015. &ZOOM, /* 36 Zoom */
  4016. &ZYXEL, /* 37 ZyXEL */
  4017. &DUMMY, /* 38 TAPI */
  4018. &NEWTB, /* 39 New-Telebit */
  4019. &MAXTECH, /* 40 MaxTech */
  4020. &DUMMY, /* 41 User-defined */
  4021. &RWV32, /* 42 Rockwell V.32 */
  4022. &RWV32B, /* 43 Rockwell V.32bis */
  4023. &RWV34, /* 44 Rockwell V.34 */
  4024. &MWAVE, /* 45 IBM Mwave */
  4025. &TELEPATH, /* 46 Gateway 2000 Telepath II 28.8 */
  4026. &MICROLINK, /* 47 MicroLink modems */
  4027. &CARDINAL, /* 48 Cardinal */
  4028. &GENERIC, /* 49 Generic high-speed */
  4029. &XJACK, /* 50 Megahertz-Xjack */
  4030. &SPIRITII, /* 51 QuickComm Spirit II */
  4031. &MONTANA, /* 52 Motorola Montana */
  4032. &COMPAQ, /* 53 Compaq Data+Fax */
  4033. &FUJITSU, /* 54 Fujitsu */
  4034. &MHZATT, /* 55 Megahertz AT&T V.34 */
  4035. &SUPRASON, /* 56 Suprasonic */
  4036. &BESTDATA, /* 57 Best Data */
  4037. &ATT1900, /* 58 AT&T Secure Data STU III 1900 */
  4038. &ATT1910, /* 59 AT&T Secure Data STU III 1910 */
  4039. &KEEPINTOUCH, /* 60 AT&T KeepinTouch */
  4040. &USRX2, /* 61 USR XJ-1560 X2 */
  4041. &ROLM_AT, /* 62 Rolm with AT command set */
  4042. &ATLAS, /* 63 Atlas / Newcom */
  4043. &CODEX, /* 64 Motorola Codex */
  4044. &MT5634ZPX, /* 65 Multitech MT5634ZPX */
  4045. &ULINKV250, /* 66 Microlink V.250 56K */
  4046. &ITUTV250, /* 67 Generic ITU-T V.250 */
  4047. &RWV90, /* 68 Rockwell V.90 56K */
  4048. &SUPRAX, /* 69 Diamond Supra Express V.90 */
  4049. &LUCENT, /* 70 Lucent Venus chipset */
  4050. &PCTEL, /* 71 PCTel */
  4051. &CONEXANT, /* 72 Conexant */
  4052. &ZOOMV34, /* 73 Zoom V.34 */
  4053. &ZOOMV90, /* 74 Zoom V.90 */
  4054. &ZOOMV92, /* 75 Zoom V.92 */
  4055. &MOTSM56 /* 76 Motorola SM56 chipset */
  4056. #endif /* MINIDIAL */
  4057. };
  4058. /*
  4059. * Declare modem names and associated numbers for command parsing,
  4060. * and also for doing number-to-name translation.
  4061. *
  4062. * The entries must be in alphabetical order by modem name.
  4063. */
  4064. struct keytab mdmtab[] = {
  4065. #ifndef MINIDIAL
  4066. "3com-usr-megahertz-56k", n_USRX2, CM_INV,
  4067. "acer-v90", n_RWV90, M_ALIAS,
  4068. "atlas-newcom-33600ifxC", n_ATLAS, 0,
  4069. "att-1900-stu-iii", n_ATT1900, 0,
  4070. "att-1910-stu-iii", n_ATT1910, 0,
  4071. "att-7300", n_ATTUPC, 0,
  4072. "att-dataport", n_DATAPORT, 0,
  4073. "att-dtdm", n_ATTDTDM, 0,
  4074. "att-isn", n_ATTISN, 0,
  4075. "att-keepintouch", n_KEEPINTOUCH, 0,
  4076. "att-switched-net", n_ATTMODEM, 0,
  4077. "att7300", n_ATTUPC, CM_INV, /* old name */
  4078. "attdtdm", n_ATTDTDM, CM_INV, /* old name */
  4079. "attisn", n_ATTISN, CM_INV, /* old name */
  4080. "attmodem", n_ATTMODEM, CM_INV, /* old name */
  4081. "bestdata", n_BESTDATA, 0,
  4082. "boca", n_BOCA, 0,
  4083. "cardinal", n_CARDINAL, 0,
  4084. #endif /* MINIDIAL */
  4085. "ccitt-v25bis", n_CCITT, CM_INV, /* Name changed to ITU-T */
  4086. #ifndef MINIDIAL
  4087. #ifdef OLDMODEMS
  4088. "cermetek", n_CERMETEK, M_OLD,
  4089. #endif /* OLDMODEMS */
  4090. "compaq", n_COMPAQ, 0,
  4091. #ifdef OLDMODEMS
  4092. "concord", n_CONCORD, M_OLD,
  4093. #endif /* OLDMODEMS */
  4094. "conexant", n_CONEXANT, 0,
  4095. "courier", n_USR, CM_INV,
  4096. "dataport", n_DATAPORT, CM_INV, /* == att-dataport */
  4097. #ifdef OLDMODEMS
  4098. "df03-ac", n_DF03, M_OLD,
  4099. "df100-series", n_DF100, M_OLD,
  4100. "df200-series", n_DF200, M_OLD,
  4101. #endif /* OLDMODEMS */
  4102. "digitel-dt22", n_DIGITEL, 0,
  4103. #endif /* MINIDIAL */
  4104. "direct", 0, CM_INV, /* Synonym for NONE */
  4105. #ifndef MINIDIAL
  4106. "fujitsu", n_FUJITSU, 0,
  4107. "gateway-telepath", n_TELEPATH, 0,
  4108. #ifdef OLDMODEMS
  4109. "gdc-212a/ed", n_GDC, M_OLD,
  4110. "ge", n_GENERIC, CM_INV|CM_ABR,
  4111. "gen", n_GENERIC, CM_INV|CM_ABR,
  4112. "gendatacomm", n_GDC, CM_INV, /* Synonym for GDC */
  4113. #endif /* OLDMODEMS */
  4114. #endif /* MINIDIAL */
  4115. "gene", n_GENERIC, CM_INV|CM_ABR,
  4116. "generic", n_GENERIC, 0,
  4117. "generic-high-speed",n_GENERIC, CM_INV,
  4118. "h", n_HAYES, CM_INV|CM_ABR,
  4119. "ha", n_HAYES, CM_INV|CM_ABR,
  4120. "hay", n_HAYES, CM_INV|CM_ABR,
  4121. "haye", n_HAYES, CM_INV|CM_ABR,
  4122. "hayes", n_HAYES, CM_INV|CM_ABR, /* Hayes 2400 */
  4123. #ifndef MINIDIAL
  4124. "hayes-1200", n_H_1200, 0,
  4125. #endif /* MINIDIAL */
  4126. "hayes-2400", n_HAYES, 0,
  4127. #ifndef MINIDIAL
  4128. "hayes-high-speed", n_H_ACCURA, 0,
  4129. "hayes-accura", n_H_ACCURA, CM_INV,
  4130. "hayes-optima", n_H_ACCURA, CM_INV,
  4131. "hayes-ultra", n_H_ULTRA, CM_INV,
  4132. "hst-courier", n_USR, CM_INV, /* Synonym for COURIER */
  4133. "intel", n_INTEL, 0,
  4134. #endif /* MINIDIAL */
  4135. "itu-t-v250", n_ITUTV250, 0,
  4136. "itu-t-v25bis", n_CCITT, 0, /* New name for CCITT */
  4137. "itu-t-v25ter/v250",n_ITUTV250, CM_INV,
  4138. #ifndef MINIDIAL
  4139. "lucent", n_LUCENT, 0,
  4140. "maxtech", n_MAXTECH, 0,
  4141. "megahertz-att-v34", n_MHZATT, 0, /* Megahertzes */
  4142. "megahertz-xjack", n_XJACK, CM_INV|CM_ABR,
  4143. "megahertz-xjack-33.6", n_XJACK, 0,
  4144. "megahertz-xjack-56k", n_USRX2, 0, /* 3COM/USR/Megahertz 33.6 PC Card */
  4145. "mi", n_MICROCOM, CM_INV|CM_ABR,
  4146. "mic", n_MICROCOM, CM_INV|CM_ABR,
  4147. "micr", n_MICROCOM, CM_INV|CM_ABR,
  4148. "micro", n_MICROCOM, CM_INV|CM_ABR,
  4149. "microc", n_MICROCOM, CM_INV|CM_ABR,
  4150. "microco", n_MICROCOM, CM_INV|CM_ABR,
  4151. "microcom", n_MICROCOM, CM_INV|CM_ABR,
  4152. "microcom-at-mode", n_UCOM_AT, 0, /* Microcom DeskPorte, etc */
  4153. "microcom-sx-mode", n_MICROCOM, 0, /* Microcom AX,QX,SX, native mode */
  4154. "microlink", n_MICROLINK, 0,
  4155. "microlink-v250", n_ULINKV250, 0,
  4156. "motorola-codex", n_CODEX, 0,
  4157. "motorola-fastalk", n_MOTOROLA, 0,
  4158. "motorola-lifestyle",n_MOTOROLA, 0,
  4159. "motorola-montana", n_MONTANA, 0,
  4160. "motorola-sm56-v90",n_MOTSM56, 0,
  4161. "mt5634zpx", n_MT5634ZPX, 0,
  4162. "multitech", n_MULTI, 0,
  4163. "mwave", n_MWAVE, 0,
  4164. #endif /* MINIDIAL */
  4165. "none", 0, 0,
  4166. #ifndef MINIDIAL
  4167. #ifndef OLDTBCODE
  4168. "old-telebit", n_TELEBIT, 0,
  4169. #endif /* OLDTBCODE */
  4170. "pctel", n_PCTEL, 0,
  4171. #ifdef OLDMODEMS
  4172. "penril", n_PENRIL, M_OLD,
  4173. #endif /* OLDMODEMS */
  4174. "ppi", n_PPI, 0,
  4175. #ifdef OLDMODEMS
  4176. "racalvadic", n_RACAL, M_OLD,
  4177. #endif /* OLDMODEMS */
  4178. "rockwell-v32", n_RWV32, 0,
  4179. "rockwell-v32bis", n_RWV32B, 0,
  4180. "rockwell-v34", n_RWV34, 0,
  4181. "rockwell-v90", n_RWV90, 0,
  4182. "rolm", n_ROLM, CM_INV|CM_ABR,
  4183. "rolm-244pc", n_ROLMAT, 0,
  4184. "rolm-600-series", n_ROLMAT, 0,
  4185. "rolm-dcm", n_ROLM, 0,
  4186. "smartlink-v90", n_USR, M_ALIAS,
  4187. "spirit-ii", n_SPIRITII, 0,
  4188. "sportster", n_USR, M_ALIAS,
  4189. "sup", n_SUPRA, CM_INV|CM_ABR,
  4190. "supr", n_SUPRA, CM_INV|CM_ABR,
  4191. "supra", n_SUPRA, CM_INV|CM_ABR,
  4192. "supra-express-v90",n_SUPRAX, 0,
  4193. "suprafaxmodem", n_SUPRA, 0,
  4194. "suprasonic", n_SUPRASON, 0,
  4195. #ifdef CK_TAPI
  4196. "tapi", n_TAPI, 0,
  4197. #endif /* CK_TAPI */
  4198. "te", n_TBNEW, CM_INV|CM_ABR,
  4199. "tel", n_TBNEW, CM_INV|CM_ABR,
  4200. "telebit", n_TBNEW, 0,
  4201. "telepath", n_TELEPATH, CM_INV,
  4202. #endif /* MINIDIAL */
  4203. "unknown", n_UNKNOWN, 0,
  4204. "user-defined", n_UDEF, 0,
  4205. #ifndef MINIDIAL
  4206. "usr", n_USR, CM_INV|CM_ABR,
  4207. "usr-212a", n_HAYES, CM_INV|M_ALIAS,
  4208. "usr-courier", n_USR, CM_INV,
  4209. "usr-megahertz-56k", n_USRX2, 0,
  4210. "usr-sportster", n_USR, CM_INV,
  4211. "usr-xj1560-x2", n_USRX2, CM_INV,
  4212. "usrobotics", n_USR, 0,
  4213. "v25bis", n_CCITT, CM_INV, /* Name changed to ITU-T */
  4214. #ifdef OLDMODEMS
  4215. "ventel", n_VENTEL, M_OLD,
  4216. #endif /* OLDMODEMS */
  4217. "zoltrix-v34", n_ZOLTRIX, 0,
  4218. "zoltrix-hsp-v90", n_PCTEL, M_ALIAS,
  4219. "zoltrix-hcf-v90", n_ITUTV250, 0,
  4220. "zoo", n_ZOOM, CM_INV|CM_ABR,
  4221. "zoom", n_ZOOM, CM_INV|CM_ABR,
  4222. "zoom-v32bis", n_ZOOM, 0,
  4223. "zoom-v34", n_ZOOMV34, 0,
  4224. "zoom-v90", n_ZOOMV90, 0,
  4225. "zoom-v92", n_ZOOMV92, 0,
  4226. "zyxel", n_ZYXEL, 0,
  4227. #endif /* MINIDIAL */
  4228. "", 0, 0
  4229. };
  4230. int nmdm = (sizeof(mdmtab) / sizeof(struct keytab)) - 1; /* Number of modems */
  4231. #define CONNECTED 1 /* For completion status */
  4232. #define D_FAILED 2
  4233. #define D_PARTIAL 3
  4234. static int tries = 0;
  4235. static int mdmecho = 0; /* Assume modem does not echo */
  4236. static char *p; /* For command strings & messages */
  4237. #define LBUFL 200
  4238. static char lbuf[LBUFL+4];
  4239. char modemmsg[LBUFL+4] = { NUL, NUL }; /* DIAL response from modem */
  4240. #ifdef DYNAMIC
  4241. #define RBUFL 256
  4242. static char *rbuf = NULL;
  4243. #else
  4244. #define RBUFL 63
  4245. static char rbuf[RBUFL+1];
  4246. #endif /* DYNAMIC */
  4247. #ifdef DYNAMIC
  4248. #define FULLNUML 256
  4249. char *fbuf = NULL; /* For full (prefixed) phone number */
  4250. #else
  4251. #define FULLNUML 100
  4252. char fbuf[FULLNUML];
  4253. #endif /* DYNAMIC */
  4254. static ckjmpbuf sjbuf;
  4255. #ifdef CK_ANSIC
  4256. static SIGTYP (*savalrm)(int); /* For saving alarm handler */
  4257. static SIGTYP (*savint)(int); /* For saving interrupt handler */
  4258. #else
  4259. static SIGTYP (*savalrm)(); /* For saving alarm handler */
  4260. static SIGTYP (*savint)(); /* For saving interrupt handler */
  4261. #endif /* CK_ANSIC */
  4262. #ifdef CKLOGDIAL
  4263. static VOID
  4264. dologdial(s) char *s; {
  4265. char buf2[16];
  4266. char * r = NULL;
  4267. int x, m, n;
  4268. extern char cxlogbuf[], uidbuf[], myhost[];
  4269. if (!s) s = "";
  4270. if ((x = strlen(s)) > 0) { /* Replace spaces by underscores */
  4271. r = (char *)malloc(x+1);
  4272. if (r) {
  4273. int i;
  4274. for (i = 0; i <= x; i++) {
  4275. if (s[i] != 0 && s[i] <= SP)
  4276. r[i] = '_';
  4277. else
  4278. r[i] = s[i];
  4279. }
  4280. s = r;
  4281. }
  4282. }
  4283. p = ckdate();
  4284. n = ckstrncpy(cxlogbuf,p,CXLOGBUFL);
  4285. if (!uidbuf[0]) {
  4286. debug(F100,"dologdial uidbuf empty","",0);
  4287. ckstrncpy(uidbuf,(char *)whoami(),UIDBUFLEN);
  4288. }
  4289. m = strlen(uidbuf)+strlen(myhost)+strlen(ttname)+strlen(s)+strlen(buf2)+32;
  4290. if (n+m < CXLOGBUFL-1) {
  4291. p = cxlogbuf+n;
  4292. if (diallcc && diallac) {
  4293. buf2[0] = '+';
  4294. ckmakmsg(&buf2[1],15,diallcc,"(",diallac,")");
  4295. } else {
  4296. ckstrncpy(buf2,"Unknown",16);
  4297. }
  4298. sprintf(p," %s %s T=DIAL H=%s D=%s N=%s O=%s ", /* safe (prechecked) */
  4299. uidbuf,
  4300. ckgetpid(),
  4301. myhost,
  4302. ttname,
  4303. s,
  4304. buf2
  4305. );
  4306. debug(F110,"dologdial cxlogbuf",cxlogbuf,0);
  4307. } else
  4308. sprintf(p,"LOGDIAL BUFFER OVERFLOW");
  4309. if (r) free(r);
  4310. }
  4311. #endif /* CKLOGDIAL */
  4312. #ifndef MINIDIAL
  4313. #ifdef COMMENT
  4314. static VOID
  4315. xcpy(to,from,len) /* Copy the given number of bytes */
  4316. register char *to, *from;
  4317. register unsigned int len; {
  4318. while (len--) *to++ = *from++;
  4319. }
  4320. #endif /* COMMENT */
  4321. #endif /* MINIDIAL */
  4322. static SIGTYP
  4323. #ifdef CK_ANSIC
  4324. dialtime(int foo) /* Timer interrupt handler */
  4325. #else
  4326. dialtime(foo) int foo; /* Timer interrupt handler */
  4327. #endif /* CK_ANSIC */
  4328. /* dialtime */ {
  4329. fail_code = F_TIME; /* Failure reason = timeout */
  4330. debug(F100,"dialtime caught SIGALRM","",0);
  4331. #ifdef BEBOX
  4332. #ifdef BE_DR_7
  4333. alarm_expired();
  4334. #endif /* BE_DR_7 */
  4335. #endif /* BEBOX */
  4336. #ifdef OS2
  4337. signal(SIGALRM, dialtime);
  4338. #endif /* OS2 */
  4339. #ifdef __EMX__
  4340. signal(SIGALRM, SIG_ACK); /* Needed for OS/2 */
  4341. #endif /* __EMX__ */
  4342. #ifdef OSK /* OS-9 */
  4343. /*
  4344. We are in an intercept routine but do not perform a F$RTE (done implicitly
  4345. by RTS), so we have to decrement the sigmask as F$RTE does. Warning:
  4346. longjump only restores the CPU registers, NOT the FPU registers. So, don't
  4347. use FPU at all or at least don't use common FPU (double or float) register
  4348. variables.
  4349. */
  4350. sigmask(-1);
  4351. #endif /* OSK */
  4352. #ifdef NTSIG
  4353. if (foo == SIGALRM)
  4354. PostAlarmSigSem();
  4355. else
  4356. PostCtrlCSem();
  4357. #else /* NTSIG */
  4358. #ifdef NT
  4359. cklongjmp(ckjaddr(sjbuf),1);
  4360. #else /* NT */
  4361. cklongjmp(sjbuf,1);
  4362. #endif /* NT */
  4363. #endif /* NTSIG */
  4364. /* NOTREACHED */
  4365. SIGRETURN;
  4366. }
  4367. static SIGTYP
  4368. #ifdef CK_ANSIC
  4369. dialint(int foo) /* Keyboard interrupt handler */
  4370. #else
  4371. dialint(foo) int foo;
  4372. #endif /* CK_ANSIC */
  4373. /* dialint */ {
  4374. fail_code = F_INT;
  4375. debug(F100,"dialint caught SIGINT","",0);
  4376. #ifdef OS2
  4377. signal(SIGINT, dialint);
  4378. debug(F100,"dialint() SIGINT caught -- dialint restored","",0) ;
  4379. #endif /* OS2 */
  4380. #ifdef __EMX__
  4381. signal(SIGINT, SIG_ACK); /* Needed for OS/2 */
  4382. #endif /* __EMX__ */
  4383. #ifdef OSK /* OS-9, see comment in dialtime() */
  4384. sigmask(-1);
  4385. #endif /* OSK */
  4386. #ifdef NTSIG
  4387. PostCtrlCSem() ;
  4388. #ifdef CK_TAPI
  4389. PostTAPIConnectSem();
  4390. PostTAPIAnswerSem();
  4391. #endif /* CK_TAPI */
  4392. #else /* NTSIG */
  4393. #ifdef NT
  4394. cklongjmp(ckjaddr(sjbuf),1);
  4395. #else /* NT */
  4396. cklongjmp(sjbuf,1);
  4397. #endif /* NT */
  4398. #endif /* NT */
  4399. SIGRETURN;
  4400. }
  4401. /*
  4402. Routine to read a character from communication device, handling TELNET
  4403. protocol negotiations in case we're connected to the modem through a
  4404. TCP/IP TELNET modem server.
  4405. */
  4406. static int
  4407. ddinc(n) int n; {
  4408. #ifdef TNCODE
  4409. int c = 0;
  4410. int done = 0;
  4411. debug(F101,"ddinc entry n","",n);
  4412. while (!done) {
  4413. c = ttinc(n);
  4414. /* debug(F000,"ddinc","",c); */
  4415. if (c < 0) return(c);
  4416. #ifndef OS2
  4417. if ((c == IAC) && network && IS_TELNET()) {
  4418. switch (tn_doop((CHAR)(c & 0xff),duplex,ttinc)) {
  4419. case 2: duplex = 0; continue;
  4420. case 1: duplex = 1;
  4421. default: continue;
  4422. }
  4423. } else done = 1;
  4424. #else /* OS2 */
  4425. done = !(c == IAC && network && IS_TELNET());
  4426. scriptwrtbuf(c); /* TELNET negotiations handled by emulator */
  4427. #endif /* OS2 */
  4428. }
  4429. return(c & 0xff);
  4430. #else /* TNCODE */
  4431. return(ttinc(n));
  4432. #endif /* TNCODE */
  4433. }
  4434. static VOID
  4435. ttslow(s,millisec) char *s; int millisec; { /* Output s-l-o-w-l-y */
  4436. #ifdef TCPSOCKET
  4437. extern int tn_nlm, tn_b_nlm;
  4438. #endif /* TCPSOCKET */
  4439. debug(F111,"ttslow",s,millisec);
  4440. if (dialdpy && (duplex || !mdmecho)) { /* Echo the command in case modem */
  4441. printf("%s\n",s); /* isn't echoing commands. */
  4442. #ifdef OS2
  4443. {
  4444. char *s2 = s; /* Echo to emulator */
  4445. while (*s2) {
  4446. scriptwrtbuf((USHORT)*s2++);
  4447. }
  4448. scriptwrtbuf((USHORT)CR);
  4449. scriptwrtbuf((USHORT)LF);
  4450. }
  4451. #endif /* OS2 */
  4452. }
  4453. for (; *s; s++) {
  4454. ttoc(*s);
  4455. #ifdef TCPSOCKET
  4456. if (*s == CR && network && IS_TELNET()) {
  4457. if (!TELOPT_ME(TELOPT_BINARY) && tn_nlm != TNL_CR)
  4458. ttoc((char)((tn_nlm == TNL_CRLF) ? LF : NUL));
  4459. else if (TELOPT_ME(TELOPT_BINARY) &&
  4460. (tn_b_nlm == TNL_CRLF || tn_b_nlm == TNL_CRNUL))
  4461. ttoc((char)((tn_b_nlm == TNL_CRLF) ? LF : NUL));
  4462. }
  4463. #endif /* TCPSOCKET */
  4464. if (millisec > 0)
  4465. msleep(millisec);
  4466. }
  4467. }
  4468. /*
  4469. * Wait for a string of characters.
  4470. *
  4471. * The characters are waited for individually, and other characters may
  4472. * be received "in between". This merely guarantees that the characters
  4473. * ARE received, and in the order specified.
  4474. */
  4475. static VOID
  4476. waitfor(s) char *s; {
  4477. CHAR c, x;
  4478. while ((c = *s++)) { /* while more characters remain... */
  4479. do { /* wait for the character */
  4480. x = (CHAR) (ddinc(0) & 0177);
  4481. debug(F000,"dial waitfor got","",x);
  4482. if (dialdpy) {
  4483. if (x != LF) conoc(x);
  4484. if (x == CR) conoc(LF);
  4485. }
  4486. } while (x != c);
  4487. }
  4488. }
  4489. static int
  4490. didweget(s,r) char *s, *r; { /* Looks in string s for response r */
  4491. int lr = (int)strlen(r); /* 0 means not found, 1 means found it */
  4492. int i;
  4493. debug(F110,"didweget",r,0);
  4494. debug(F110," in",s,0);
  4495. for (i = (int)strlen(s)-lr; i >= 0; i--)
  4496. if ( s[i] == r[0] ) if ( !strncmp(s+i,r,lr) ) return( 1 );
  4497. return( 0 );
  4498. }
  4499. /* R E S E T -- Reset alarms, etc. on exit. */
  4500. static VOID
  4501. dreset() {
  4502. debug(F100,"dreset resetting alarm and signal handlers","",0);
  4503. alarm(0);
  4504. signal(SIGALRM,savalrm); /* restore alarm handler */
  4505. signal(SIGINT,savint); /* restore interrupt handler */
  4506. debug(F100,"dreset alarm and signal handlers reset","",0);
  4507. }
  4508. /*
  4509. Call this routine when the modem reports that it has connected at a certain
  4510. speed, giving that speed as the argument. If the connection speed is not
  4511. the same as Kermit's current communication speed, AND the modem interface
  4512. speed is not locked (i.e. DIAL SPEED-MATCHING is not ON), then change the
  4513. device speed to the one given.
  4514. */
  4515. static VOID
  4516. #ifdef CK_ANSIC
  4517. spdchg(long s)
  4518. #else
  4519. spdchg(s) long s;
  4520. #endif /* CK_ANSIC */
  4521. /* spdchg */ {
  4522. int s2;
  4523. if (!mdmspd) /* If modem interface speed locked, */
  4524. return; /* don't do this. */
  4525. if (speed != s) { /* Speeds differ? */
  4526. s2 = s / 10L; /* Convert to cps expressed as int */
  4527. if (ttsspd(s2) < 0) { /* Change speed. */
  4528. printf(" WARNING - speed change to %ld failed.\r\n",s);
  4529. } else {
  4530. printf(" Speed changed to %ld.\r\n",s);
  4531. speed = s; /* Update global speed variable */
  4532. }
  4533. }
  4534. }
  4535. /*
  4536. Display all characters received from modem dialer through this routine,
  4537. for consistent handling of carriage returns and linefeeds.
  4538. */
  4539. static VOID
  4540. #ifdef CK_ANSIC
  4541. dialoc(char c)
  4542. #else
  4543. dialoc(c) char c;
  4544. #endif /* CK_ANSIC */
  4545. { /* dialoc */ /* Dial Output Character */
  4546. if (dialdpy) {
  4547. if (c != LF) conoc(c); /* Don't echo LF */
  4548. if (c == CR) conoc(LF); /* Echo CR as CRLF */
  4549. }
  4550. }
  4551. #ifndef NOSPL
  4552. char *
  4553. getdm(x) int x; { /* Return dial modifier */
  4554. MDMINF * mp;
  4555. int m;
  4556. int ishayes = 0;
  4557. m = mdmtyp;
  4558. if (m < 1)
  4559. if (mdmsav > -1)
  4560. m = mdmsav;
  4561. if (m < 1)
  4562. return("");
  4563. #ifndef MINIDIAL
  4564. if (m == n_TAPI)
  4565. m = n_HAYES;
  4566. #endif /* MINIDIAL */
  4567. mp = modemp[m];
  4568. ishayes = (dialcapas ? dialcapas : mp->capas) & CKD_AT;
  4569. switch (x) {
  4570. case VN_DM_LP:
  4571. return(ishayes ? "," : "");
  4572. case VN_DM_SP:
  4573. #ifdef MINIDIAL
  4574. return("");
  4575. #else
  4576. return(m == n_USR ? "/" : "");
  4577. #endif /* MINIDIAL */
  4578. case VN_DM_PD:
  4579. return(ishayes ? "P" : "");
  4580. case VN_DM_TD:
  4581. return(ishayes ? "T" : "");
  4582. case VN_DM_WA:
  4583. return(ishayes ? "@" : "");
  4584. case VN_DM_WD:
  4585. return(ishayes ? "W" : "");
  4586. case VN_DM_RC:
  4587. return(ishayes ? ";" : "");
  4588. case VN_DM_HF:
  4589. return(ishayes ? "!" : "");
  4590. case VN_DM_WB:
  4591. return(ishayes ? "$" : "");
  4592. }
  4593. return("");
  4594. }
  4595. #endif /* NOSPL */
  4596. static VOID
  4597. getdialmth() {
  4598. if (dialmauto && diallcc) { /* If DIAL METHOD AUTO... */
  4599. int i; /* and we know our area code... */
  4600. for (i = 0; i < ndialtocc; i++) { /* First check Tone countries list */
  4601. if (!strcmp(dialtocc[i],diallcc)) {
  4602. dialmth = XYDM_T;
  4603. break;
  4604. }
  4605. }
  4606. for (i = 0; i < ndialpucc; i++) { /* Then Pulse countries list */
  4607. if (!strcmp(dialpucc[i],diallcc)) {
  4608. dialmth = XYDM_P;
  4609. break;
  4610. }
  4611. }
  4612. }
  4613. }
  4614. VOID /* Get dialing defaults from environment */
  4615. getdialenv() {
  4616. char *p = NULL;
  4617. int i, x;
  4618. makestr(&p,getenv("K_DIAL_DIRECTORY"));
  4619. if (p) {
  4620. int i;
  4621. xwords(p,(MAXDDIR - 2),dialdir,0);
  4622. for (i = 0; i < (MAXDDIR - 1); i++) {
  4623. if (!dialdir[i+1])
  4624. break;
  4625. else
  4626. dialdir[i] = dialdir[i+1];
  4627. }
  4628. ndialdir = i;
  4629. }
  4630. xmakestr(&diallcc,getenv("K_COUNTRYCODE")); /* My country code */
  4631. xmakestr(&dialixp,getenv("K_LD_PREFIX")); /* My long-distance prefix */
  4632. xmakestr(&dialldp,getenv("K_INTL_PREFIX")); /* My international prefix */
  4633. xmakestr(&dialldp,getenv("K_TF_PREFIX")); /* Ny Toll-free prefix */
  4634. #ifndef NOICP
  4635. p = getenv("K_DIAL_METHOD"); /* Local dial method */
  4636. if (p) if (*p) {
  4637. extern struct keytab dial_m[];
  4638. extern int ndial_m;
  4639. i = lookup(dial_m,p,ndial_m,&x);
  4640. if (i > -1) {
  4641. if (i == XYDM_A) {
  4642. dialmauto = 1;
  4643. dialmth = XYDM_D;
  4644. } else {
  4645. dialmauto = 0;
  4646. dialmth = i;
  4647. }
  4648. }
  4649. }
  4650. #endif /* NOICP */
  4651. p = NULL;
  4652. xmakestr(&p,getenv("K_TF_AREACODE")); /* Toll-free areacodes */
  4653. if (p) {
  4654. int i;
  4655. xwords(p,7,dialtfc,0);
  4656. for (i = 0; i < 8; i++) {
  4657. if (!dialtfc[i+1])
  4658. break;
  4659. else
  4660. dialtfc[i] = dialtfc[i+1];
  4661. }
  4662. ntollfree = i;
  4663. free(p);
  4664. }
  4665. for (i = 0; i < MAXTPCC; i++) { /* Clear Tone/Pulse country lists */
  4666. dialtocc[i] = NULL;
  4667. dialpucc[i] = NULL;
  4668. }
  4669. for (i = 0; i < MAXTPCC; i++) { /* Init Tone country list */
  4670. if (tonecc[i])
  4671. makestr(&(dialtocc[i]),tonecc[i]);
  4672. else
  4673. break;
  4674. }
  4675. ndialtocc = i;
  4676. for (i = 0; i < MAXTPCC; i++) { /* Init Pulse country list */
  4677. if (pulsecc[i])
  4678. makestr(&(dialpucc[i]),pulsecc[i]);
  4679. else
  4680. break;
  4681. }
  4682. ndialpucc = i;
  4683. if (diallcc) { /* Have country code */
  4684. if (!strcmp(diallcc,"1")) { /* If it's 1 */
  4685. if (!dialldp) /* Set these prefixes... */
  4686. makestr(&dialldp,"1");
  4687. if (!dialtfp)
  4688. makestr(&dialtfp,"1");
  4689. if (!dialixp)
  4690. makestr(&dialixp,"011");
  4691. if (ntollfree == 0) { /* Toll-free area codes */
  4692. if ((dialtfc[0] = malloc(4))) {
  4693. ckstrncpy(dialtfc[0],"800",4); /* 1970-something */
  4694. ntollfree++;
  4695. if ((dialtfc[1] = malloc(4))) {
  4696. ckstrncpy(dialtfc[1],"888",4); /* 1996 */
  4697. ntollfree++;
  4698. if ((dialtfc[2] = malloc(4))) {
  4699. ckstrncpy(dialtfc[2],"877",4); /* 5 April 1998 */
  4700. ntollfree++;
  4701. if ((dialtfc[3] = malloc(4))) {
  4702. ckstrncpy(dialtfc[3],"866",4); /* 2000? */
  4703. ntollfree++;
  4704. }
  4705. }
  4706. }
  4707. }
  4708. }
  4709. } else if (!strcmp(diallcc,"358") &&
  4710. ((int) strcmp(zzndate(),"19961011") > 0)
  4711. ) { /* Finland */
  4712. if (!dialldp) /* Long-distance prefix */
  4713. makestr(&dialldp,"9");
  4714. if (!dialixp) /* International dialing prefix */
  4715. makestr(&dialixp,"990");
  4716. } else { /* Not NANP or Finland */
  4717. if (!dialldp)
  4718. makestr(&dialldp,"0");
  4719. if (!dialixp)
  4720. makestr(&dialixp,"00");
  4721. }
  4722. }
  4723. xmakestr(&diallac,getenv("K_AREACODE"));
  4724. xmakestr(&dialpxo,getenv("K_PBX_OCP"));
  4725. xmakestr(&dialpxi,getenv("K_PBX_ICP"));
  4726. p = getenv("K_PBX_XCH");
  4727. #ifdef COMMENT
  4728. xmakestr(&dialpxx,p);
  4729. #else
  4730. if (p) if (*p) {
  4731. char * s = NULL;
  4732. char * pp[MAXPBXEXCH+2];
  4733. makestr(&s,p); /* Make a copy for poking */
  4734. if (s) {
  4735. xwords(s,MAXPBXEXCH+1,pp,0); /* Note: pp[] is 1-based. */
  4736. for (i = 0; i <= MAXPBXEXCH; i++) {
  4737. if (!pp[i+1]) break;
  4738. makestr(&(dialpxx[i]),pp[i+1]);
  4739. ndialpxx++;
  4740. }
  4741. makestr(&s,NULL); /* Free poked copy */
  4742. }
  4743. }
  4744. #endif /* COMMENT */
  4745. }
  4746. static int
  4747. dialfail(x) int x; {
  4748. char * s;
  4749. fail_code = x;
  4750. debug(F101,"ckudial dialfail","",x);
  4751. dreset(); /* Reset alarm and signal handlers */
  4752. printf("%s Failure: ", func_code == 0 ? "DIAL" : "ANSWER");
  4753. if (dialdpy) { /* If showing progress */
  4754. debug(F100,"dial display is on","",0);
  4755. p = ck_time(); /* get current time; */
  4756. if (*p) printf("%s: ",p);
  4757. }
  4758. switch (fail_code) { /* Type of failure */
  4759. case F_TIME: /* Timeout */
  4760. if (dial_what == DW_INIT)
  4761. printf ("Timed out while trying to initialize modem.\n");
  4762. else if (dial_what == DW_DIAL)
  4763. printf ("%s interval expired.\n",
  4764. func_code == 0 ? "DIAL TIMEOUT" : "ANSWER timeout");
  4765. else
  4766. printf("Timeout.\n");
  4767. fflush(stdout);
  4768. if (mdmcapas & CKD_AT)
  4769. ttoc('\015'); /* Send CR to interrupt dialing */
  4770. /* Some Hayes modems don't fail with BUSY on busy lines */
  4771. dialsta = DIA_TIMO;
  4772. debug(F110,"dial","timeout",0);
  4773. break;
  4774. case F_INT: /* Dialing interrupted */
  4775. printf ("Interrupted.\n");
  4776. fflush(stdout);
  4777. #ifndef NOXFER
  4778. interrupted = 1;
  4779. #endif /* NOXFER */
  4780. debug(F111,"dial","interrupted",mdmcapas & CKD_AT);
  4781. if (mdmcapas & CKD_AT)
  4782. ttoc('\015'); /* Send CR to interrupt dialing */
  4783. dialsta = DIA_INTR;
  4784. break;
  4785. case F_MODEM: /* Modem detected a failure */
  4786. debug(F110,"dialfail()","lbuf",0);
  4787. if (lbuf && *lbuf) {
  4788. printf(" \"");
  4789. for (s = lbuf; *s; s++)
  4790. if (isprint(*s))
  4791. putchar(*s); /* Display printable reason */
  4792. printf ("\"");
  4793. } else printf(func_code == 0 ?
  4794. " Call not completed." :
  4795. " Call did not come in."
  4796. );
  4797. printf("\n");
  4798. debug(F110,"dial",lbuf,0);
  4799. if (dialsta < 0) dialsta = DIA_UNSP;
  4800. break;
  4801. case F_MINIT: /* Failure to initialize modem */
  4802. printf ("Error initializing modem.\n");
  4803. debug(F110,"dial","modem init",0);
  4804. dialsta = DIA_NOIN;
  4805. break;
  4806. default:
  4807. printf("unknown\n");
  4808. debug(F110,"dial","unknown",0);
  4809. fflush(stdout);
  4810. if (mdmcapas & CKD_AT)
  4811. ttoc('\015'); /* Send CR to interrupt dialing */
  4812. dialsta = DIA_INTR;
  4813. }
  4814. #ifdef DYNAMIC
  4815. if (rbuf) free(rbuf); rbuf = NULL;
  4816. if (fbuf) free(fbuf); fbuf = NULL;
  4817. #endif /* DYNAMIC */
  4818. if (dialsta < 0) dialsta = DIA_UERR; /* Set failure code */
  4819. return(0); /* Return zero (important) */
  4820. }
  4821. /* C K D I A L -- Dial up the remote system */
  4822. /* Returns 1 if call completed, 0 otherwise */
  4823. static int mdmwait, mdmstat = 0;
  4824. #ifndef CK_TAPI
  4825. static
  4826. #endif /* CK_TAPI */
  4827. int waitct;
  4828. int mdmwaitd = 10 ; /* dialtmo / mdmwait difference */
  4829. static char c;
  4830. static char *telnbr;
  4831. static int wr = 0; /* wr = wake rate */
  4832. static char * ws; /* ws = wake string */
  4833. static char * xnum = NULL;
  4834. static int inited = 0;
  4835. static SIGTYP
  4836. #ifdef CK_ANSIC
  4837. _dodial(void * threadinfo)
  4838. #else /* CK_ANSIC */
  4839. _dodial(threadinfo) VOID * threadinfo;
  4840. #endif /* CK_ANSIC */
  4841. /* _dodial */ {
  4842. char c2;
  4843. char *dcmd, *s, *flocmd = NULL;
  4844. int x = 0, n = F_TIME;
  4845. #ifdef NTSIG
  4846. signal( SIGINT, dialint );
  4847. if (threadinfo) { /* Thread local storage... */
  4848. TlsSetValue(TlsIndex,threadinfo);
  4849. }
  4850. #endif /* NTSIG */
  4851. dcmd = dialcmd ? dialcmd : mp->dial_str;
  4852. if ((int)strlen(dcmd) + (int)strlen(telnbr) > (LBUFL - 2)) {
  4853. printf("DIAL command + phone number too long!\n");
  4854. dreset();
  4855. #ifdef DYNAMIC
  4856. if (rbuf) free(rbuf); rbuf = NULL;
  4857. if (fbuf) free(fbuf); fbuf = NULL;
  4858. #endif /* DYNAMIC */
  4859. #ifdef NTSIG
  4860. ckThreadEnd(threadinfo);
  4861. #endif /* NTSIG */
  4862. SIGRETURN; /* No conversation with modem to complete dialing */
  4863. }
  4864. makestr(&xnum,telnbr);
  4865. getdialmth(); /* Get dial method */
  4866. #ifdef CK_ATDT
  4867. /* Combine the SET DIAL METHOD command with the DIAL command string */
  4868. if (!dialcmd && /* Using default DIAL command */
  4869. (mdmcapas & CKD_AT) && /* AT command set only */
  4870. ((dialmth == XYDM_T && !dialtone) || /* and using default */
  4871. (dialmth == XYDM_P && !dialpulse))) { /* modem commands... */
  4872. char c;
  4873. debug(F110,"dial atdt xnum 1",xnum,0);
  4874. s = dcmd;
  4875. debug(F110,"dial atdt s",s,0);
  4876. if (*telnbr != 'T' &&
  4877. *telnbr != 'P' &&
  4878. *telnbr != 't' &&
  4879. *telnbr != 'p' &&
  4880. !ckstrcmp(s,"atd",3,0) &&
  4881. s[3] != 'T' &&
  4882. s[3] != 'P' &&
  4883. s[3] != 't' &&
  4884. s[3] != 'p') {
  4885. char xbuf[200];
  4886. c = (dialmth == XYDM_T) ? 'T' : 'P';
  4887. if (islower(s[0]))
  4888. c = tolower(c);
  4889. if ((int)strlen(telnbr) < 199) {
  4890. sprintf(xbuf,"%c%s",c,telnbr);
  4891. makestr(&xnum,xbuf);
  4892. }
  4893. }
  4894. }
  4895. #endif /* CK_ATDT */
  4896. debug(F111,"_dodial",xnum,xredial);
  4897. /* Hang up the modem (in case it wasn't "on hook") */
  4898. /* But only if SET DIAL HANGUP ON... */
  4899. if (!xredial) { /* Modem not initalized yet. */
  4900. inited = 0;
  4901. }
  4902. if (!xredial || !inited) {
  4903. if (dialhup() < 0) { /* Hangup first */
  4904. debug(F100,"_dodial dialhup failed","",0);
  4905. #ifndef MINIDIAL
  4906. if (mdmcapas & CKD_TB) /* Telebits might need a BREAK */
  4907. ttsndb(); /* first. */
  4908. #endif /* MINIDIAL */
  4909. if (dialhng && dialsta != DIA_PART) { /* If hangup failed, */
  4910. ttclos(0); /* close and reopen the device. */
  4911. if (ttopen(ttname,&local,mymdmtyp,0) < 0) {
  4912. printf("Sorry, Can't hang up communication device.\n");
  4913. printf("Try 'set line %s' again.\n",ttname);
  4914. dialsta = DIA_HANG;
  4915. #ifdef DYNAMIC
  4916. if (rbuf) free(rbuf); rbuf = NULL;
  4917. if (fbuf) free(fbuf); fbuf = NULL;
  4918. #endif /* DYNAMIC */
  4919. dreset();
  4920. #ifdef NTSIG
  4921. ckThreadEnd(threadinfo);
  4922. #endif /* NTSIG */
  4923. SIGRETURN;
  4924. }
  4925. }
  4926. }
  4927. inited = 0; /* We hung up so must reinit */
  4928. }
  4929. #ifndef MINIDIAL
  4930. /* Don't start talking to Rolm too soon */
  4931. if (mymdmtyp == n_ROLM && dialsta != DIA_PART)
  4932. msleep(500);
  4933. #endif /* MINIDIAL */
  4934. if (dialsta != DIA_PART /* Some initial setups. */
  4935. #ifndef MINIDIAL
  4936. && mymdmtyp != n_ATTUPC
  4937. #endif /* MINIDIAL */
  4938. ) {
  4939. fail_code = F_MINIT; /* Default failure code */
  4940. dial_what = DW_INIT; /* What I'm Doing Now */
  4941. if (dialdpy) { /* If showing progress, */
  4942. p = ck_time(); /* get timestamp. */
  4943. if (!inited)
  4944. if (*p)
  4945. printf(" Initializing: %s...\n",p);
  4946. }
  4947. }
  4948. #ifndef MINIDIAL
  4949. #ifdef ATT7300
  4950. if (mymdmtyp == n_ATTUPC) {
  4951. /*
  4952. For ATT7300/Unix PC's with their special internal modem. Whole dialing
  4953. process is handled right here, an exception to the normal structure.
  4954. Timeout and user interrupts are enabled during dialing. attdial() is in
  4955. file ckutio.c. - jrd
  4956. */
  4957. _PROTOTYP( int attdial, (char *, long, char *) );
  4958. fail_code = F_MODEM; /* Default failure code */
  4959. dial_what = DW_DIAL;
  4960. if (dialdpy) { /* If showing progress */
  4961. p = ck_time(); /* get current time; */
  4962. if (*p)
  4963. printf(" Dialing: %s...\n",p);
  4964. }
  4965. alarm(waitct); /* Set alarm */
  4966. if (attdial(ttname,speed,telnbr)) { /* dial internal modem */
  4967. dreset(); /* reset alarms, etc. */
  4968. printf(" Call failed.\r\n");
  4969. dialhup(); /* Hangup the call */
  4970. #ifdef DYNAMIC
  4971. if (rbuf) free(rbuf); rbuf = NULL;
  4972. if (fbuf) free(fbuf); fbuf = NULL;
  4973. #endif /* DYNAMIC */
  4974. dialsta = DIA_UERR;
  4975. #ifdef NTSIG
  4976. ckThreadEnd(threadinfo);
  4977. #endif /* NTSIG */
  4978. SIGRETURN; /* return failure */
  4979. }
  4980. dreset(); /* reset alarms, etc. */
  4981. ttpkt(speed,FLO_DIAX,parity); /* cancel dialing ioctl */
  4982. if (!quiet && !backgrd) {
  4983. if (dialdpy) {
  4984. printf("\n");
  4985. printf(" Call complete.\r\n");
  4986. } else if (modemmsg[0])
  4987. printf(" Call complete: \"%s\".\r\n",(char *)modemmsg);
  4988. else
  4989. printf(" Call complete.\r\n");
  4990. }
  4991. #ifdef CKLOGDIAL
  4992. dologdial(telnbr);
  4993. #endif /* CKLOGDIAL */
  4994. dialsta = DIA_OK;
  4995. #ifdef DYNAMIC
  4996. if (rbuf) free(rbuf); rbuf = NULL;
  4997. if (fbuf) free(fbuf); fbuf = NULL;
  4998. #endif /* DYNAMIC */
  4999. #ifdef NTSIG
  5000. ckThreadEnd(threadinfo);
  5001. #endif /* NTSIG */
  5002. SIGRETURN; /* No conversation with modem to complete dialing */
  5003. } else
  5004. #endif /* ATT7300 */
  5005. #ifdef CK_TAPI
  5006. if (tttapi && !tapipass) { /* TAPI Dialing */
  5007. switch (func_code) {
  5008. case 0: /* Dial */
  5009. if (cktapidial(telnbr)) {
  5010. fail_code = 0;
  5011. if (partial) {
  5012. dialsta = DIA_PART;
  5013. } else {
  5014. dialsta = DIA_OK;
  5015. speed = ttgspd();
  5016. }
  5017. } else {
  5018. if (dialsta == DIA_PART)
  5019. cktapihangup();
  5020. if (!fail_code)
  5021. fail_code = F_MODEM;
  5022. dialsta = DIA_TAPI;
  5023. }
  5024. break;
  5025. case 1: { /* Answer */
  5026. long strttime = time((long *)NULL);
  5027. long diff = 0;
  5028. do {
  5029. if (dialatmo > 0) {
  5030. strttime += diff;
  5031. waitct -= diff;
  5032. }
  5033. fail_code = 0;
  5034. if (cktapianswer()) { /* SUCCESS */
  5035. dialsta = DIA_OK;
  5036. speed = ttgspd();
  5037. break;
  5038. } else { /* FAILURE */
  5039. if (fail_code) {
  5040. dialsta = DIA_TAPI;
  5041. break;
  5042. } else {
  5043. fail_code = F_MODEM;
  5044. dialsta = DIA_TAPI;
  5045. }
  5046. }
  5047. if (dialatmo > 0) {
  5048. diff = time((long *)NULL) - strttime;
  5049. }
  5050. } while ((dialatmo > 0) ? (diff < waitct) : 1);
  5051. break;
  5052. }
  5053. }
  5054. #ifdef NTSIG
  5055. ckThreadEnd(threadinfo);
  5056. #endif /* NTSIG */
  5057. SIGRETURN;
  5058. } else
  5059. #endif /* CK_TAPI */
  5060. #endif /* MINIDIAL */
  5061. /* Modems with AT command set... */
  5062. if ((mdmcapas & CKD_AT) && dialsta != DIA_PART) {
  5063. if (dialpace > -1) /* Set intercharacter pacing */
  5064. wr = dialpace;
  5065. else
  5066. wr = mp->wake_rate;
  5067. if (dialini) /* Get wakeup/init string */
  5068. ws = dialini;
  5069. else
  5070. ws = mp->wake_str;
  5071. #ifdef COMMENT
  5072. if (!ws) ws = "\015"; /* If none, use CR */
  5073. #endif /* COMMENT */
  5074. /* First get the modem's attention and enable result codes */
  5075. for (tries = 0; tries < 5; tries++) { /* Send short command */
  5076. if (tries > 0) {
  5077. ttoc('\015'); /* AT must go first for speed */
  5078. msleep(wr); /* detection. */
  5079. }
  5080. if (mymdmtyp == n_GENERIC) /* Force word result codes */
  5081. ttslow("ATQ0V1\015",wr); /* for generic modem type */
  5082. else
  5083. ttslow("ATQ0\015",wr);
  5084. mdmstat = getok(tries < 2 ? 2 : tries, 1); /* Get response */
  5085. if (mdmstat > 0) break; /* OK - done */
  5086. if (dialdpy && tries > 0) {
  5087. printf("\r\n No response from modem");
  5088. if (tries == 4) {
  5089. printf(".\r\n");
  5090. dialsta = DIA_NRSP;
  5091. #ifdef DYNAMIC
  5092. if (rbuf) free(rbuf); rbuf = NULL;
  5093. if (fbuf) free(fbuf); fbuf = NULL;
  5094. #endif /* DYNAMIC */
  5095. #ifdef NTSIG
  5096. ckThreadEnd(threadinfo);
  5097. #endif /* NTSIG */
  5098. SIGRETURN; /* return failure */
  5099. }
  5100. printf(", retrying%s...\r\n",
  5101. (tries > 1) ? " again" : "");
  5102. fflush(stdout);
  5103. }
  5104. ttflui();
  5105. switch (tries) {
  5106. case 0: msleep(100); break;
  5107. case 1: ttsndb(); break;
  5108. default:
  5109. if (network) {
  5110. ttsndb();
  5111. } else {
  5112. if (tries == 2) {
  5113. tthang();
  5114. ttflui();
  5115. } else {
  5116. mdmhup();
  5117. }
  5118. inited = 0;
  5119. }
  5120. }
  5121. fflush(stdout);
  5122. }
  5123. debug(F101,"_dodial ATQ0 mdmstat","",mdmstat);
  5124. if (xredial && inited) { /* Redialing... */
  5125. ttoc('\015'); /* Cancel previous */
  5126. msleep(250); /* Wait a bit */
  5127. #ifdef COMMENT
  5128. /* This wasn't the problem... */
  5129. ttflui(); /* Clear out stuff from modem setup */
  5130. ttslow("ATS7=60\015",wr); /* Redo carrier wait */
  5131. getok(4,1); /* Get response */
  5132. #endif /* COMMENT */
  5133. alarm(0); /* Just in case... */
  5134. ttflui(); /* Clear out stuff from modem setup */
  5135. goto REDIAL; /* Skip setup - we already did it */
  5136. }
  5137. /*
  5138. Do flow control next because a long init string echoing back could
  5139. cause data overruns, causing us to miss the OK, or (worse) to get out
  5140. of sync entirely.
  5141. */
  5142. x = 0; /* User said SET DIAL FLOW RTS/CTS */
  5143. if (dialfc == FLO_RTSC || /* Even if Kermit's FLOW isn't... */
  5144. (dialfc == FLO_AUTO && flow == FLO_RTSC)) {
  5145. if (dialhwfc) { /* User-defined HWFC string */
  5146. if (*dialhwfc) {
  5147. x = 1;
  5148. flocmd = dialhwfc;
  5149. }
  5150. } else if ((mdmcapas & CKD_HW) && *(mp->hwfc_str)) {
  5151. x = 1;
  5152. flocmd = mp->hwfc_str;
  5153. }
  5154. } else if (dialfc == FLO_XONX || /* User said SET DIAL FLOW SOFT */
  5155. (dialfc == FLO_AUTO && flow == FLO_XONX)) {
  5156. if (dialswfc) {
  5157. if (*dialswfc) {
  5158. x = 1;
  5159. flocmd = dialswfc;
  5160. }
  5161. } else if ((mdmcapas & CKD_SW) && *(mp->swfc_str)) {
  5162. x = 1;
  5163. flocmd = mp->swfc_str;
  5164. }
  5165. } else if (dialfc == FLO_NONE) { /* User said SET DIAL FLOW NONE */
  5166. if (dialnofc) {
  5167. if (*dialnofc) {
  5168. x = 1;
  5169. flocmd = dialnofc;
  5170. }
  5171. } else if (mp->nofc_str && *(mp->nofc_str)) {
  5172. x = 1;
  5173. flocmd = mp->nofc_str;
  5174. }
  5175. }
  5176. if (x) { /* Send the flow control command */
  5177. debug(F110,"_dodial flocmd",flocmd,0);
  5178. for (tries = 4; tries > 0; tries--) { /* Send the command */
  5179. ttslow(flocmd,wr);
  5180. mdmstat = getok(5,1);
  5181. if (mdmstat > 0) break;
  5182. if (dialdpy && tries > 1)
  5183. printf(" No response from modem, retrying%s...\n",
  5184. (tries < 4) ? " again" : "");
  5185. }
  5186. #ifdef CK_TTSETFLOW
  5187. #ifdef CK_RTSCTS
  5188. /*
  5189. So far only ckutio.c has ttsetflow().
  5190. We have just told the modem to turn on RTS/CTS flow control and the modem
  5191. has said OK. But we ourselves have not turned it on yet because of the
  5192. disgusting ttpkt(...FLO_DIAL...) hack. So now, if the computer does not
  5193. happen to be asserting RTS, the modem will no longer send characters to it.
  5194. So at EXACTLY THIS POINT, we must enable RTS/CTS in the device driver.
  5195. */
  5196. if (dialfc == FLO_RTSC ||
  5197. (dialfc == FLO_AUTO && flow == FLO_RTSC)) {
  5198. ttsetflow(FLO_RTSC);
  5199. }
  5200. #endif /* CK_RTSCTS */
  5201. #endif /* CK_TTSETFLOW */
  5202. }
  5203. ttflui(); /* Clear out stuff from modem setup */
  5204. msleep(250);
  5205. if (!ws) goto xdialec; /* No init string */
  5206. if (!*ws) goto xdialec;
  5207. for (tries = 4; tries > 0; tries--) { /* Send init string */
  5208. ttslow(ws,wr);
  5209. mdmstat = getok(4,1); /* Get response */
  5210. if (mdmstat > 0) break;
  5211. if (dialdpy && tries > 1)
  5212. printf(" No response from modem, retrying%s...\n",
  5213. (tries < 4) ? " again" : "");
  5214. }
  5215. debug(F101,"_dodial wake_str mdmstat","",mdmstat);
  5216. if (mdmstat < 1) { /* Initialized OK? */
  5217. dialfail(F_MINIT); /* No, fail. */
  5218. #ifdef NTSIG
  5219. ckThreadEnd(threadinfo);
  5220. #endif /* NTSIG */
  5221. SIGRETURN;
  5222. }
  5223. #ifndef MINIDIAL
  5224. } else if (mymdmtyp == n_ATTDTDM && dialsta != DIA_PART) { /* AT&T ... */
  5225. ttsndb(); /* Send BREAK */
  5226. #endif /* MINIDIAL */
  5227. } else if (dialsta != DIA_PART) { /* All others */
  5228. /* Place modem into command mode */
  5229. ws = dialini ? dialini : mp->wake_str;
  5230. if (ws && (int)strlen(ws) > 0) {
  5231. debug(F111,"_dodial default, wake string", ws, wr);
  5232. ttslow(ws, wr);
  5233. } else debug(F100,"_dodial no wake_str","",0);
  5234. if (mp->wake_prompt && (int)strlen(mp->wake_prompt) > 0) {
  5235. debug(F110,"_dodial default, waiting for wake_prompt",
  5236. mp->wake_prompt,0);
  5237. alarm(10);
  5238. waitfor(mp->wake_prompt);
  5239. alarm(0);
  5240. } else debug(F100,"_dodial no wake_prompt","",0);
  5241. }
  5242. /* Handle error correction, data compression, and flow control... */
  5243. xdialec:
  5244. if (dialsta != DIA_PART) {
  5245. alarm(0); /* Turn off alarm */
  5246. debug(F100,"_dodial got wake prompt","",0);
  5247. msleep(500); /* Allow settling time */
  5248. /* Enable/disable error-correction */
  5249. x = 0;
  5250. if (dialec) { /* DIAL ERROR-CORRECTION is ON */
  5251. if (dialecon) { /* SET DIAL STRING ERROR-CORRECTION */
  5252. if (*dialecon) {
  5253. x = 1;
  5254. ttslow(dialecon, wr);
  5255. }
  5256. } else if ((mdmcapas & CKD_EC) && *(mp->ec_on_str)) {
  5257. x = 1;
  5258. ttslow(mp->ec_on_str, wr);
  5259. }
  5260. #ifdef COMMENT
  5261. else printf(
  5262. "WARNING - I don't know how to turn on EC for this modem\n"
  5263. );
  5264. #endif /* COMMENT */
  5265. } else {
  5266. if (dialecoff) { /* DIAL ERROR-CORRECTION OFF */
  5267. if (*dialecoff) {
  5268. x = 1;
  5269. ttslow(dialecoff, wr);
  5270. }
  5271. } else if ((mdmcapas & CKD_EC) && *(mp->ec_off_str)) {
  5272. x = 1;
  5273. ttslow(mp->ec_off_str, wr);
  5274. }
  5275. #ifdef COMMENT
  5276. else printf(
  5277. "WARNING - I don't know how to turn off EC for this modem\n"
  5278. );
  5279. #endif /* COMMENT */
  5280. }
  5281. /* debug(F101,"ckudia xx_ok","",xx_ok); */
  5282. if (x && xx_ok) { /* Look for OK response */
  5283. debug(F100,"ckudia calling xx_ok for EC","",0);
  5284. x = (*xx_ok)(5,1);
  5285. debug(F101,"ckudia xx_ok","",x);
  5286. if (x < 0) {
  5287. printf("WARNING - Trouble enabling error-correction.\n");
  5288. printf(
  5289. " Likely cause: Your modem is an RPI model, which does not have built-in\n");
  5290. printf(" error correction and data compression.");
  5291. }
  5292. }
  5293. /* Enable/disable data compression */
  5294. if (x > 0) x = 0;
  5295. if (dialdc) {
  5296. if (x < 0 || !dialec) {
  5297. printf(
  5298. "WARNING - You can't have compression without error correction.\n");
  5299. } else if (dialdcon) { /* SET DIAL STRING ... */
  5300. if (*dialdcon) {
  5301. x = 1;
  5302. ttslow(dialdcon, wr);
  5303. }
  5304. } else if ((mdmcapas & CKD_DC) && *(mp->dc_on_str)) {
  5305. x = 1;
  5306. ttslow(mp->dc_on_str, wr);
  5307. }
  5308. #ifdef COMMENT
  5309. else printf(
  5310. "WARNING - I don't know how to turn on DC for this modem\n"
  5311. );
  5312. #endif /* COMMENT */
  5313. } else {
  5314. if (dialdcoff) {
  5315. if (*dialdcoff) {
  5316. x = 1;
  5317. ttslow(dialdcoff, wr);
  5318. }
  5319. } else if ((mdmcapas & CKD_DC) && *(mp->dc_off_str)) {
  5320. x = 1;
  5321. ttslow(mp->dc_off_str, wr);
  5322. }
  5323. #ifdef COMMENT
  5324. else printf(
  5325. "WARNING - I don't know how to turn off compression for this modem\n"
  5326. );
  5327. #endif /* COMMENT */
  5328. }
  5329. if (x && xx_ok) { /* Look for OK response */
  5330. x = (*xx_ok)(5,1);
  5331. if (x < 0) printf("WARNING - Trouble enabling compression\n");
  5332. }
  5333. }
  5334. #ifndef NOXFER
  5335. #ifndef MINIDIAL
  5336. if (mdmcapas & CKD_KS && dialsta != DIA_PART) { /* Kermit spoof */
  5337. int r; /* Register */
  5338. char tbcmdbuf[64]; /* Command buffer */
  5339. switch (mymdmtyp) {
  5340. case n_MICROCOM: /* Microcoms in SX mode */
  5341. if (dialksp)
  5342. sprintf(tbcmdbuf,"APM1;KMC%d\015",stchr); /* safe */
  5343. else
  5344. sprintf(tbcmdbuf,"APM0\015"); /* safe */
  5345. ttslow(tbcmdbuf, MICROCOM.wake_rate);
  5346. alarm(3);
  5347. waitfor(mp->wake_prompt);
  5348. alarm(0);
  5349. break;
  5350. case n_TELEBIT: /* Old and new Telebits */
  5351. case n_TBNEW:
  5352. if (!dialksp) {
  5353. sprintf(tbcmdbuf,"ATS111=0\015"); /* safe */
  5354. } else {
  5355. switch (parity) { /* S111 value depends on parity */
  5356. case 'e': r = 12; break;
  5357. case 'm': r = 13; break;
  5358. case 'o': r = 11; break;
  5359. case 's': r = 14; break;
  5360. case 0:
  5361. default: r = 10; break;
  5362. }
  5363. sprintf(tbcmdbuf,"ATS111=%d S112=%d\015",r,stchr); /* safe */
  5364. }
  5365. ttslow(tbcmdbuf, wr);
  5366. /* Not all Telebit models have the Kermit spoof, so ignore response. */
  5367. if (xx_ok) { /* Get modem's response */
  5368. x = (*xx_ok)(5,1);
  5369. }
  5370. }
  5371. }
  5372. #endif /* MINIDIAL */
  5373. #endif /* NOXFER */
  5374. /* Speaker */
  5375. if (mymdmtyp != n_GENERIC &&
  5376. (mdmcapas & CKD_AT) && (dialsta != DIA_PART) &&
  5377. !dialspon && !dialspoff &&
  5378. !dialvol1 && !dialvol2 &&!dialvol3) {
  5379. /* AT command set and commands have not been customized */
  5380. /* so combine speaker and volume commands. */
  5381. if (mdmspk)
  5382. sprintf(lbuf,"ATM1L%d%c",mdmvol,13); /* safe */
  5383. else
  5384. sprintf(lbuf,"ATM0%c",13); /* safe */
  5385. ttslow(lbuf,wr); /* Send command */
  5386. getok(5,1); /* Get but ignore response */
  5387. } else if (dialsta != DIA_PART) { /* Customized or not AT commands */
  5388. x = 0; /* Do it the hard way */
  5389. if (mdmspk) {
  5390. if (dialspon) {
  5391. if (*dialspon) {
  5392. x = 1;
  5393. ttslow(dialspon,wr);
  5394. }
  5395. } else {
  5396. if (mp->sp_on_str[0]) {
  5397. x = 1;
  5398. ttslow(mp->sp_on_str,wr);
  5399. }
  5400. }
  5401. } else {
  5402. /* s = dialspoff ? dialspoff : mp->sp_off_str; */
  5403. if (dialspoff) {
  5404. if (*dialspoff) {
  5405. x = 1;
  5406. ttslow(dialspoff,wr);
  5407. }
  5408. } else {
  5409. if (mp->sp_off_str[0]) {
  5410. x = 1;
  5411. ttslow(mp->sp_off_str,wr);
  5412. }
  5413. }
  5414. }
  5415. if (x) {
  5416. if (xx_ok) /* Get response */
  5417. x = (*xx_ok)(5,1);
  5418. if (x && mdmspk) { /* Good response and speaker on? */
  5419. switch (mdmvol) { /* Yes, send volume command. */
  5420. case 0:
  5421. case 1:
  5422. s = dialvol1 ? dialvol1 : mp->vol1_str; break;
  5423. case 2:
  5424. s = dialvol2 ? dialvol2 : mp->vol2_str; break;
  5425. case 3:
  5426. s = dialvol3 ? dialvol3 : mp->vol3_str; break;
  5427. default:
  5428. s = NULL;
  5429. }
  5430. if (s) if (*s) { /* Send volume command. */
  5431. ttslow(s, wr);
  5432. if (xx_ok) /* Get response but ignore it */
  5433. (*xx_ok)(5,1);
  5434. }
  5435. }
  5436. }
  5437. }
  5438. #ifndef CK_ATDT
  5439. /* Dialing Method */
  5440. if (dialmth && dialsta != DIA_PART) { /* If dialing method specified... */
  5441. char *s = ""; /* Do it here... */
  5442. if (dialmth == XYDM_T && dialtone) /* Tone */
  5443. s = dialtone;
  5444. else if (dialmth == XYDM_P && dialpulse) /* Pulse */
  5445. s = dialpulse;
  5446. if (s) if (*s) {
  5447. ttslow(s, wr);
  5448. if (xx_ok) /* Get modem's response */
  5449. (*xx_ok)(5,1); /* (but ignore it...) */
  5450. }
  5451. }
  5452. #endif /* CK_ATDT */
  5453. if (dialidt) { /* Ignore dialtone? */
  5454. char *s = "";
  5455. s = dialx3 ? dialx3 : mp->ignoredt;
  5456. if (s) if (*s) {
  5457. ttslow(s, wr);
  5458. if (xx_ok) /* Get modem's response */
  5459. (*xx_ok)(5,1); /* (but ignore it...) */
  5460. }
  5461. }
  5462. {
  5463. char *s = ""; /* Last-minute init string? */
  5464. s = dialini2 ? dialini2 : mp->ini2;
  5465. if (s) if (*s) {
  5466. ttslow(s, wr);
  5467. if (xx_ok) /* Get modem's response */
  5468. (*xx_ok)(5,1); /* (but ignore it...) */
  5469. }
  5470. }
  5471. if (func_code == 1) { /* ANSWER (not DIAL) */
  5472. char *s;
  5473. s = dialaaon ? dialaaon : mp->aa_on_str;
  5474. if (!s) s = "";
  5475. if (*s) {
  5476. /* Here we would handle caller ID */
  5477. ttslow(s, (dialpace > -1) ? wr : mp->dial_rate);
  5478. if (xx_ok) /* Get modem's response */
  5479. (*xx_ok)(5,1); /* (but ignore it...) */
  5480. } else {
  5481. printf(
  5482. "WARNING - I don't know how to enable autoanswer for this modem.\n"
  5483. );
  5484. } /* And skip all the phone-number & dialing stuff... */
  5485. alarm(waitct); /* This much time allowed. */
  5486. debug(F101,"_dodial ANSWER waitct","",waitct);
  5487. } else { /* DIAL (not ANSWER) */
  5488. if (dialsta != DIA_PART) { /* Last dial was not partial */
  5489. char *s = "";
  5490. #ifdef COMMENT
  5491. s = dialaaoff ? dialaaoff : mp->aa_off_str;
  5492. #endif /* COMMENT */
  5493. if (s) if (*s) {
  5494. ttslow(s, (dialpace > -1) ? wr : mp->dial_rate);
  5495. if (xx_ok) /* Get modem's response */
  5496. (*xx_ok)(5,1); /* (but ignore it...) */
  5497. }
  5498. /* Put modem into dialing mode, if the modem requires it. */
  5499. if (mp->dmode_str && *(mp->dmode_str)) {
  5500. ttslow(mp->dmode_str, (dialpace > -1) ? wr : mp->dial_rate);
  5501. savalrm = signal(SIGALRM,dialtime);
  5502. alarm(10);
  5503. /* Wait for prompt, if any expected */
  5504. if (mp->dmode_prompt && *(mp->dmode_prompt)) {
  5505. waitfor(mp->dmode_prompt);
  5506. msleep(300);
  5507. }
  5508. alarm(0); /* Turn off alarm on dialing prompts */
  5509. signal(SIGALRM,savalrm); /* Restore alarm */
  5510. }
  5511. }
  5512. /* AT-Command-Set non-Generic modem */
  5513. if (mdmcapas & CKD_AT && mymdmtyp != n_GENERIC &&
  5514. dialsta != DIA_PART) {
  5515. if (mdmwait > 255) /* If larger than maximum, */
  5516. mdmwait = 255; /* make it maximum. */
  5517. if (dialesc > 0 && /* Modem escape character is set */
  5518. dialmhu > 0) { /* Hangup method is modem command */
  5519. int x = dialesc;
  5520. if (dialesc < 0 || dialesc > 127)
  5521. x = 128;
  5522. sprintf(lbuf,
  5523. "ATS2=%dS7=%d\015",
  5524. dialesc ? x : mp->esc_char, mdmwait); /* safe */
  5525. } else
  5526. sprintf(lbuf,"ATS7=%d%c",mdmwait,13); /* safe */
  5527. ttslow(lbuf,wr); /* Set it. */
  5528. mdmstat = getok(5,1); /* Get response from modem */
  5529. /* If it gets an error, go ahead anyway */
  5530. debug(F101,"_dodial S7 mdmstat","",mdmstat);
  5531. }
  5532. ttflui(); /* Clear out stuff from modem setup */
  5533. inited = 1; /* Remember modem is initialized */
  5534. REDIAL:
  5535. if ((int)strlen(dcmd) + (int)strlen(xnum) > LBUFL)
  5536. ckstrncpy(lbuf,"NUMBER TOO LONG!",LBUFL);
  5537. else
  5538. sprintf(lbuf, dcmd, xnum); /* safe (prechecked) */
  5539. debug(F110,"dialing",lbuf,0);
  5540. /* Send the dialing string */
  5541. ttslow(lbuf,dialpace > -1 ? wr : mp->dial_rate);
  5542. fail_code = F_MODEM; /* New default failure code changes */
  5543. dial_what = DW_DIAL; /* and our state, too. */
  5544. if (dialdpy) { /* If showing progress */
  5545. p = ck_time(); /* get current time; */
  5546. if (*p) printf(" Dialing: %s...\n",p);
  5547. #ifdef VMS
  5548. printf(" \n");
  5549. fflush(stdout);
  5550. #endif /* VMS */
  5551. }
  5552. alarm(waitct); /* This much time allowed. */
  5553. debug(F101,"_dodial waitct","",waitct);
  5554. #ifndef MINIDIAL
  5555. #ifdef OLDMODEMS
  5556. switch (mymdmtyp) {
  5557. case n_RACAL: /* Acknowledge dialing string */
  5558. sleep(3);
  5559. ttflui();
  5560. ttoc('\015');
  5561. break;
  5562. case n_VENTEL:
  5563. waitfor("\012\012"); /* Ignore the first two strings */
  5564. break;
  5565. default:
  5566. break;
  5567. }
  5568. #endif /* OLDMODEMS */
  5569. #endif /* MINIDIAL */
  5570. }
  5571. /* Check for connection */
  5572. mdmstat = 0; /* No status yet */
  5573. lbuf[0] = NUL; /* Default reason for failure */
  5574. debug(F101,"dial awaiting response, mymdmtyp","",mymdmtyp);
  5575. #ifndef NOSPL
  5576. modemmsg[0] = NUL;
  5577. #endif /* NOSPL */
  5578. while (mdmstat == 0) { /* Till we get a result or time out */
  5579. if ((mdmcapas & CKD_AT) && nonverbal) { /* AT command set */
  5580. gethrn(); /* In digit result mode */
  5581. if (partial && dialsta == DIA_ERR) {
  5582. /*
  5583. If we get an error here, the phone is still
  5584. off hook so we have to hang it up.
  5585. */
  5586. dialhup();
  5587. dialsta = DIA_ERR; /* (because dialhup() changes it) */
  5588. }
  5589. continue;
  5590. } else if (mymdmtyp == n_UNKNOWN) { /* Unknown modem type */
  5591. int x, y = waitct;
  5592. mdmstat = D_FAILED; /* Assume failure. */
  5593. while (y-- > -1) {
  5594. x = ttchk();
  5595. if (x > 0) {
  5596. if (x > LBUFL) x = LBUFL;
  5597. x = ttxin(x,(CHAR *)lbuf);
  5598. if ((x > 0) && dialdpy) conol(lbuf);
  5599. } else if (network
  5600. #ifdef TN_COMPORT
  5601. && !istncomport()
  5602. #endif /* TN_COMPORT */
  5603. && x < 0) { /* Connection dropped */
  5604. inited = 0;
  5605. #ifdef NTSIG
  5606. ckThreadEnd(threadinfo);
  5607. #endif /* NTSIG */
  5608. dialsta = DIA_IO; /* Call it an I/O error */
  5609. #ifdef DYNAMIC
  5610. if (rbuf) free(rbuf); rbuf = NULL;
  5611. if (fbuf) free(fbuf); fbuf = NULL;
  5612. #endif /* DYNAMIC */
  5613. SIGRETURN;
  5614. }
  5615. x = ttgmdm(); /* Try to read modem signals */
  5616. if (x < 0) break; /* Can't, fail. */
  5617. if (x & BM_DCD) { /* Got signals OK. Carrier present? */
  5618. mdmstat = CONNECTED; /* Yes, done. */
  5619. break;
  5620. } /* No, keep waiting. */
  5621. sleep(1);
  5622. }
  5623. continue;
  5624. }
  5625. for (n = -1; n < LBUFL-1; ) { /* Accumulate modem response */
  5626. int xx;
  5627. c2 = (char) (xx = ddinc(0)); /* Read a character, blocking */
  5628. if (xx < 1) /* Ignore NULs and errors */
  5629. continue; /* (Timeout will handle errors) */
  5630. else /* Real character, keep it */
  5631. lbuf[++n] = (char) (c2 & 0177);
  5632. dialoc(lbuf[n]); /* Maybe echo it */
  5633. if (mdmcapas & CKD_V25) { /* V.25bis dialing... */
  5634. /*
  5635. This assumes that V.25bis indications are all at least 3 characters long
  5636. and are terminated by either CRLF or LFCR.
  5637. */
  5638. if (mymdmtyp == n_CCITT) {
  5639. if (n < 3) continue;
  5640. if ((lbuf[n] == CR) && (lbuf[n-1] == LF)) break;
  5641. if ((lbuf[n] == LF) && (lbuf[n-1] == CR)) break;
  5642. }
  5643. #ifndef MINIDIAL
  5644. else if (mymdmtyp == n_DIGITEL) {
  5645. if (((lbuf[n] == CR) && (lbuf[n-1] == LF)) ||
  5646. ((lbuf[n] == LF) && (lbuf[n-1] == CR)))
  5647. break;
  5648. else
  5649. continue;
  5650. }
  5651. #endif /* MINIDIAL */
  5652. } else { /* All others, break on CR or LF */
  5653. if ( lbuf[n] == CR || lbuf[n] == LF ) break;
  5654. }
  5655. }
  5656. lbuf[++n] = '\0'; /* Terminate response from modem */
  5657. debug(F111,"_dodial modem response",lbuf,n);
  5658. #ifndef NOSPL
  5659. ckstrncpy(modemmsg,lbuf,LBUFL); /* Call result message */
  5660. lbuf[79] = NUL;
  5661. {
  5662. int x; /* Strip junk from end */
  5663. x = (int)strlen(modemmsg) - 1;
  5664. while (x > -1) {
  5665. if (modemmsg[x] < (char) 33)
  5666. modemmsg[x] = NUL;
  5667. else
  5668. break;
  5669. x--;
  5670. }
  5671. }
  5672. #endif /* NOSPL */
  5673. if (mdmcapas & CKD_AT) { /* Hayes AT command set */
  5674. gethrw(); /* in word result mode */
  5675. if (partial && dialsta == DIA_ERR) {
  5676. dialhup();
  5677. dialsta = DIA_ERR; /* (because dialhup() changes it) */
  5678. }
  5679. continue;
  5680. } else if (mdmcapas & CKD_V25) { /* CCITT command set */
  5681. if (didweget(lbuf,"VAL")) { /* Dial command confirmation */
  5682. #ifndef MINIDIAL
  5683. if (mymdmtyp == n_CCITT)
  5684. #endif /* MINIDIAL */
  5685. continue; /* Go back and read more */
  5686. #ifndef MINIDIAL
  5687. /* Digitel doesn't give an explicit connect confirmation message */
  5688. else {
  5689. int n;
  5690. for (n = -1; n < LBUFL-1; ) {
  5691. lbuf[++n] = c2 = (char) (ddinc(0) & 0177);
  5692. dialoc(lbuf[n]);
  5693. if (((lbuf[n] == CR) && (lbuf[n-1] == LF)) ||
  5694. ((lbuf[n] == LF) && (lbuf[n-1] == CR)))
  5695. break;
  5696. }
  5697. mdmstat = CONNECTED; /* Assume we're connected */
  5698. if (dialdpy && carrier != CAR_OFF) {
  5699. #ifdef TN_COMPORT
  5700. if (istncomport()) {
  5701. int i;
  5702. for (i = 0; i < 5; i++) {
  5703. debug(F100,"TN Com Port DCD wait...","",0);
  5704. if ((n = ttgmdm()) >= 0) {
  5705. if ((n & BM_DCD))
  5706. break;
  5707. msleep(500);
  5708. tnc_wait(
  5709. (CHAR *)"_dodial waiting for DCD",1);
  5710. }
  5711. }
  5712. } else
  5713. #endif /* TN_COMPORT */
  5714. sleep(1); /* Wait a second */
  5715. n = ttgmdm(); /* Try to read modem signals */
  5716. if ((n > -1) && ((n & BM_DCD) == 0))
  5717. printf("WARNING - no carrier\n");
  5718. }
  5719. }
  5720. #endif /* MINIDIAL */
  5721. /* Standard V.25bis stuff */
  5722. } else if (didweget(lbuf,"CNX")) { /* Connected */
  5723. mdmstat = CONNECTED;
  5724. } else if (didweget(lbuf, "INV")) {
  5725. mdmstat = D_FAILED; /* Command error */
  5726. dialsta = DIA_ERR;
  5727. ckstrncpy(lbuf,"INV",LBUFL);
  5728. } else if (didweget(lbuf,"CFI")) { /* Call Failure */
  5729. if (didweget(lbuf,"AB")) { /* Interpret reason code */
  5730. ckstrncpy(lbuf,"AB: Timed out",LBUFL);
  5731. dialsta = DIA_TIMO;
  5732. } else if (didweget(lbuf,"CB")) {
  5733. ckstrncpy(lbuf,"CB: Local DCE Busy",LBUFL);
  5734. dialsta = DIA_NRDY;
  5735. } else if (didweget(lbuf,"ET")) {
  5736. ckstrncpy(lbuf,"ET: Busy",LBUFL);
  5737. dialsta = DIA_BUSY;
  5738. } else if (didweget(lbuf, "NS")) {
  5739. ckstrncpy(lbuf,"NS: Number not stored",LBUFL);
  5740. dialsta = DIA_ERR;
  5741. } else if (didweget(lbuf,"NT")) {
  5742. ckstrncpy(lbuf,"NT: No answer",LBUFL);
  5743. dialsta = DIA_NOAN;
  5744. } else if (didweget(lbuf,"RT")) {
  5745. ckstrncpy(lbuf,"RT: Ring tone",LBUFL);
  5746. dialsta = DIA_RING;
  5747. } else if (didweget(lbuf,"PV")) {
  5748. ckstrncpy(lbuf,"PV: Parameter value error",LBUFL);
  5749. dialsta = DIA_ERR;
  5750. } else if (didweget(lbuf,"PS")) {
  5751. ckstrncpy(lbuf,"PS: Parameter syntax error",LBUFL);
  5752. dialsta = DIA_ERR;
  5753. } else if (didweget(lbuf,"MS")) {
  5754. ckstrncpy(lbuf,"MS: Message syntax error",LBUFL);
  5755. dialsta = DIA_ERR;
  5756. } else if (didweget(lbuf,"CU")) {
  5757. ckstrncpy(lbuf,"CU: Command unknown",LBUFL);
  5758. dialsta = DIA_ERR;
  5759. } else if (didweget(lbuf,"FC")) {
  5760. ckstrncpy(lbuf,"FC: Forbidden call",LBUFL);
  5761. dialsta = DIA_NOAC;
  5762. }
  5763. mdmstat = D_FAILED;
  5764. } else if (didweget(lbuf,"INC")) { /* Incoming Call */
  5765. ckstrncpy(lbuf,"INC: Incoming call",LBUFL);
  5766. dialsta = DIA_RING;
  5767. mdmstat = D_FAILED;
  5768. } else if (didweget(lbuf,"DLC")) { /* Delayed Call */
  5769. ckstrncpy(lbuf,"DLC: Delayed call",LBUFL);
  5770. dialsta = DIA_NOAN;
  5771. mdmstat = D_FAILED;
  5772. } else /* Response was probably an echo. */
  5773. #ifndef MINIDIAL
  5774. if (mymdmtyp == n_CCITT)
  5775. #endif /* MINIDIAL */
  5776. continue;
  5777. #ifndef MINIDIAL
  5778. else /* Digitel: If no error, connect. */
  5779. mdmstat = CONNECTED;
  5780. #endif /* MINIDIAL */
  5781. break;
  5782. } else if (n) { /* Non-Hayes-compatibles... */
  5783. switch (mymdmtyp) {
  5784. #ifndef MINIDIAL
  5785. case n_ATTMODEM:
  5786. /* Careful - "Connected" / "Not Connected" */
  5787. if (didweget(lbuf,"Busy")) {
  5788. mdmstat = D_FAILED;
  5789. dialsta = DIA_BUSY;
  5790. } else if (didweget(lbuf,"Not connected") ||
  5791. didweget(lbuf,"Not Connected")) {
  5792. mdmstat = D_FAILED;
  5793. dialsta = DIA_NOCA;
  5794. } else if (didweget(lbuf,"No dial tone") ||
  5795. didweget(lbuf,"No Dial Tone")) {
  5796. mdmstat = D_FAILED;
  5797. dialsta = DIA_NODT;
  5798. } else if (didweget(lbuf,"No answer") ||
  5799. didweget(lbuf,"No Answer")) {
  5800. mdmstat = D_FAILED;
  5801. dialsta = DIA_NOAN;
  5802. } else if (didweget(lbuf,"Answered") ||
  5803. didweget(lbuf,"Connected")) {
  5804. mdmstat = CONNECTED;
  5805. dialsta = DIA_OK;
  5806. }
  5807. break;
  5808. case n_ATTISN:
  5809. if (didweget(lbuf,"ANSWERED")) {
  5810. mdmstat = CONNECTED;
  5811. dialsta = DIA_OK;
  5812. } else if (didweget(lbuf,"BUSY")) {
  5813. mdmstat = D_FAILED;
  5814. dialsta = DIA_BUSY;
  5815. } else if (didweget(lbuf,"DISCONNECT")) {
  5816. mdmstat = D_FAILED;
  5817. dialsta = DIA_DISC;
  5818. } else if (didweget(lbuf,"NO ANSWER")) {
  5819. mdmstat = D_FAILED;
  5820. dialsta = DIA_NOAN;
  5821. } else if (didweget(lbuf,"WRONG ADDRESS")) {
  5822. mdmstat = D_FAILED;
  5823. dialsta = DIA_NOAC;
  5824. }
  5825. break;
  5826. case n_ATTDTDM:
  5827. if (didweget(lbuf,"ANSWERED")) {
  5828. mdmstat = CONNECTED;
  5829. } else if (didweget(lbuf,"BUSY")) {
  5830. mdmstat = D_FAILED;
  5831. dialsta = DIA_BUSY;
  5832. } else if (didweget(lbuf,"CHECK OPTIONS")) {
  5833. mdmstat = D_FAILED;
  5834. dialsta = DIA_ERR;
  5835. } else if (didweget(lbuf,"DISCONNECTED")) {
  5836. mdmstat = D_FAILED;
  5837. dialsta = DIA_DISC;
  5838. } else if (didweget(lbuf,"DENIED")) {
  5839. mdmstat = D_FAILED;
  5840. dialsta = DIA_NOAC;
  5841. }
  5842. #ifdef DEBUG
  5843. #ifdef ATT6300
  5844. /* Horrible hack lost in history. */
  5845. else if (deblog && didweget(lbuf,"~~"))
  5846. mdmstat = CONNECTED;
  5847. #endif /* ATT6300 */
  5848. #endif /* DEBUG */
  5849. break;
  5850. #ifdef OLDMODEMS
  5851. case n_CERMETEK:
  5852. if (didweget(lbuf,"\016A")) {
  5853. mdmstat = CONNECTED;
  5854. ttslow("\016U 1\015",200); /* Make transparent*/
  5855. }
  5856. break;
  5857. case n_DF03:
  5858. /* Because response lacks CR or NL . . . */
  5859. c = (char) (ddinc(0) & 0177);
  5860. dialoc(c);
  5861. debug(F000,"dial df03 got","",c);
  5862. if ( c == 'A' ) mdmstat = CONNECTED;
  5863. if ( c == 'B' ) mdmstat = D_FAILED;
  5864. break;
  5865. case n_DF100: /* DF100 has short response codes */
  5866. if (strcmp(lbuf,"A") == 0) {
  5867. mdmstat = CONNECTED; /* Attached */
  5868. dialsta = DIA_OK;
  5869. } else if (strcmp(lbuf,"N") == 0) {
  5870. mdmstat = D_FAILED;
  5871. dialsta = DIA_NOAN; /* No answer or no dialtone */
  5872. } else if (strcmp(lbuf,"E") == 0 || /* Error */
  5873. strcmp(lbuf,"R") == 0) { /* "Ready" (?) */
  5874. mdmstat = D_FAILED;
  5875. dialsta = DIA_ERR; /* Command error */
  5876. }
  5877. /* otherwise fall thru... */
  5878. case n_DF200:
  5879. if (didweget(lbuf,"Attached")) {
  5880. mdmstat = CONNECTED;
  5881. dialsta = DIA_OK;
  5882. /*
  5883. * The DF100 will respond with "Attached" even if DTR
  5884. * and/or carrier are not present. Another reason to
  5885. * (also) wait for carrier?
  5886. */
  5887. } else if (didweget(lbuf,"Busy")) {
  5888. mdmstat = D_FAILED;
  5889. dialsta = DIA_BUSY;
  5890. } else if (didweget(lbuf,"Disconnected")) {
  5891. mdmstat = D_FAILED;
  5892. dialsta = DIA_DISC;
  5893. } else if (didweget(lbuf,"Error")) {
  5894. mdmstat = D_FAILED;
  5895. dialsta = DIA_ERR;
  5896. } else if (didweget(lbuf,"No answer")) {
  5897. mdmstat = D_FAILED;
  5898. dialsta = DIA_NOAN;
  5899. } else if (didweget(lbuf,"No dial tone")) {
  5900. mdmstat = D_FAILED;
  5901. dialsta = DIA_NODT;
  5902. } else if (didweget(lbuf,"Speed:)")) {
  5903. mdmstat = D_FAILED;
  5904. dialsta = DIA_ERR;
  5905. }
  5906. /*
  5907. * It appears that the "Speed:..." response comes after an
  5908. * "Attached" response, so this is never seen. HOWEVER,
  5909. * it would be very handy to detect this and temporarily
  5910. * reset the speed, since it's a nuisance otherwise.
  5911. * If we wait for some more input from the modem, how do
  5912. * we know if it's from the remote host or the modem?
  5913. * Carrier reportedly doesn't get set until after the
  5914. * "Speed:..." response (if any) is sent. Another reason
  5915. * to (also) wait for carrier.
  5916. */
  5917. break;
  5918. case n_GDC:
  5919. if (didweget(lbuf,"ON LINE"))
  5920. mdmstat = CONNECTED;
  5921. else if (didweget(lbuf,"NO CONNECT"))
  5922. mdmstat = D_FAILED;
  5923. break;
  5924. case n_PENRIL:
  5925. if (didweget(lbuf,"OK")) {
  5926. mdmstat = CONNECTED;
  5927. } else if (didweget(lbuf,"BUSY")) {
  5928. mdmstat = D_FAILED;
  5929. dialsta = DIA_BUSY;
  5930. } else if (didweget(lbuf,"NO RING")) {
  5931. mdmstat = D_FAILED;
  5932. dialsta = DIA_NOCA;
  5933. }
  5934. break;
  5935. case n_RACAL:
  5936. if (didweget(lbuf,"ON LINE"))
  5937. mdmstat = CONNECTED;
  5938. else if (didweget(lbuf,"FAILED CALL"))
  5939. mdmstat = D_FAILED;
  5940. break;
  5941. #endif /* OLDMODEMS */
  5942. case n_ROLM:
  5943. if (didweget(lbuf,"CALLING"))
  5944. mdmstat = 0;
  5945. else if (didweget(lbuf,"COMPLETE"))
  5946. mdmstat = CONNECTED;
  5947. else if (didweget(lbuf,"FAILED") ||
  5948. didweget(lbuf,"ABANDONDED")) {
  5949. mdmstat = D_FAILED;
  5950. dialsta = DIA_NOCA;
  5951. } else if (didweget(lbuf,"NOT AVAILABLE") ||
  5952. didweget(lbuf,"LACKS PERMISSION") ||
  5953. didweget(lbuf,"NOT A DATALINE") ||
  5954. didweget(lbuf,"INVALID DATA LINE NUMBER") ||
  5955. didweget(lbuf,"INVALID GROUP NAME")) {
  5956. mdmstat = D_FAILED;
  5957. dialsta = DIA_NOAC;
  5958. } else if (didweget(lbuf,"BUSY")) {
  5959. mdmstat = D_FAILED;
  5960. dialsta = DIA_BUSY;
  5961. } else if (didweget(lbuf,"DOES NOT ANSWER")) {
  5962. mdmstat = D_FAILED;
  5963. dialsta = DIA_NOAN;
  5964. }
  5965. break;
  5966. #ifdef OLDMODEMS
  5967. case n_VENTEL:
  5968. if (didweget(lbuf,"ONLINE!") ||
  5969. didweget(lbuf,"Online!")) {
  5970. mdmstat = CONNECTED;
  5971. } else if (didweget(lbuf,"BUSY") ||
  5972. didweget(lbuf,"Busy")) {
  5973. mdmstat = D_FAILED;
  5974. dialsta = DIA_BUSY;
  5975. } else if (didweget(lbuf,"DEAD PHONE")) {
  5976. mdmstat = D_FAILED;
  5977. dialsta = DIA_DISC;
  5978. }
  5979. break;
  5980. case n_CONCORD:
  5981. if (didweget(lbuf,"INITIATING"))
  5982. mdmstat = CONNECTED;
  5983. else if (didweget(lbuf,"BUSY")) {
  5984. mdmstat = D_FAILED;
  5985. dialsta = DIA_BUSY;
  5986. } else if (didweget(lbuf,"CALL FAILED")) {
  5987. mdmstat = D_FAILED;
  5988. dialsta = DIA_NOCA;
  5989. }
  5990. break;
  5991. #endif /* OLDMODEMS */
  5992. case n_MICROCOM:
  5993. /* "RINGBACK" means phone line ringing, continue */
  5994. if (didweget(lbuf,"NO CONNECT")) {
  5995. mdmstat = D_FAILED;
  5996. dialsta = DIA_NOCA;
  5997. } else if (didweget(lbuf,"BUSY")) {
  5998. mdmstat = D_FAILED;
  5999. dialsta = DIA_BUSY;
  6000. } else if (didweget(lbuf,"NO DIALTONE")) {
  6001. mdmstat = D_FAILED;
  6002. dialsta = DIA_NODT;
  6003. } else if (didweget(lbuf,"COMMAND ERROR")) {
  6004. mdmstat = D_FAILED;
  6005. dialsta = DIA_ERR;
  6006. } else if (didweget(lbuf,"IN USE")) {
  6007. mdmstat = D_FAILED;
  6008. dialsta = DIA_NOAC;
  6009. } else if (didweget(lbuf,"CONNECT")) {
  6010. mdmstat = CONNECTED;
  6011. /* trailing speed ignored */
  6012. }
  6013. break;
  6014. #endif /* MINIDIAL */
  6015. default:
  6016. printf(
  6017. "PROGRAM ERROR - No response handler for modem type %d\n",
  6018. mymdmtyp);
  6019. mdmstat = D_FAILED;
  6020. dialsta = DIA_ERR;
  6021. }
  6022. }
  6023. } /* while (mdmstat == 0) */
  6024. debug(F101,"_dodial alarm off","",x);
  6025. alarm(0);
  6026. if (mdmstat == D_FAILED) { /* Failure detected by modem */
  6027. dialfail(F_MODEM);
  6028. #ifdef NTSIG
  6029. ckThreadEnd(threadinfo);
  6030. #endif /* NTSIG */
  6031. SIGRETURN;
  6032. } else if (mdmstat == D_PARTIAL ) { /* Partial dial command OK */
  6033. msleep(500);
  6034. debug(F100,"dial partial","",0);
  6035. } else { /* Call was completed */
  6036. int x;
  6037. msleep(700); /* In case modem signals blink */
  6038. debug(F100,"dial succeeded","",0);
  6039. if (
  6040. #ifndef MINIDIAL
  6041. mymdmtyp != n_ROLM /* Rolm has weird modem signaling */
  6042. #else
  6043. 1
  6044. #endif /* MINIDIAL */
  6045. ) {
  6046. alarm(3); /* In case ttpkt() gets stuck... */
  6047. ttpkt(speed,FLO_DIAX,parity); /* Cancel dialing state ioctl */
  6048. alarm(0);
  6049. }
  6050. /*
  6051. In case CD went off in the interval between call completion and return
  6052. from ttpkt()...
  6053. */
  6054. if (carrier != CAR_OFF) {
  6055. if ((x = ttgmdm()) >= 0) {
  6056. #ifdef TN_COMPORT
  6057. if (istncomport() && !(x & BM_DCD)) {
  6058. int i;
  6059. for (i = 0; i < 5; i++) {
  6060. msleep(500);
  6061. tnc_wait((CHAR *)"_dodial waiting for DCD",1);
  6062. if ((x = ttgmdm()) >= 0) {
  6063. if ((x & BM_DCD))
  6064. break;
  6065. }
  6066. }
  6067. }
  6068. #endif /* TN_COMPORT */
  6069. if (!(x & BM_DCD))
  6070. printf("WARNING: Carrier seems to have dropped...\n");
  6071. }
  6072. }
  6073. }
  6074. dreset(); /* Reset alarms and signals. */
  6075. if (!quiet && !backgrd) {
  6076. if (dialdpy && (p = ck_time())) { /* If DIAL DISPLAY ON, */
  6077. printf(" %sall complete: %s.\n", /* include timestamp. */
  6078. (mdmstat == D_PARTIAL) ?
  6079. "Partial c" :
  6080. "C",
  6081. p );
  6082. } else if (modemmsg[0]) {
  6083. printf (" %sall complete: \"%s\".\n",
  6084. (mdmstat == D_PARTIAL) ? "Partial c" : "C",
  6085. (char *)modemmsg
  6086. );
  6087. } else {
  6088. printf (" %sall complete.\n",
  6089. (mdmstat == D_PARTIAL) ?
  6090. "Partial c" :
  6091. "C"
  6092. );
  6093. }
  6094. }
  6095. #ifdef CKLOGDIAL
  6096. dologdial(telnbr);
  6097. #endif /* CKLOGDIAL */
  6098. #ifdef DYNAMIC
  6099. if (rbuf) free(rbuf); rbuf = NULL;
  6100. if (fbuf) free(fbuf); fbuf = NULL;
  6101. #endif /* DYNAMIC */
  6102. dialsta = (mdmstat == D_PARTIAL) ? DIA_PART : DIA_OK;
  6103. #ifdef NTSIG
  6104. ckThreadEnd(threadinfo);
  6105. #endif /* NTSIG */
  6106. SIGRETURN;
  6107. }
  6108. static SIGTYP
  6109. #ifdef CK_ANSIC
  6110. faildial(void * threadinfo)
  6111. #else /* Not CK_ANSIC */
  6112. faildial(threadinfo) VOID * threadinfo;
  6113. #endif /* CK_ANSIC */
  6114. /* faildial */ {
  6115. debug(F100,"longjmp returns to dial routine","",0);
  6116. dialfail(fail_code);
  6117. SIGRETURN;
  6118. }
  6119. /*
  6120. nbr = number to dial (string)
  6121. x1 = Retry counter
  6122. x2 = Number counter
  6123. fc = Function code:
  6124. 0 == DIAL
  6125. 1 == ANSWER
  6126. 2 == INIT/CONFIG
  6127. 3 == PARTIAL DIAL
  6128. */
  6129. int
  6130. #ifdef OLD_DIAL
  6131. ckdial(nbr) char *nbr;
  6132. #else
  6133. ckdial(nbr, x1, x2, fc, redial) char *nbr; int x1, x2, fc, redial;
  6134. #endif /* OLD_DIAL */
  6135. /* ckdial */ {
  6136. #define ERMSGL 50
  6137. char errmsg[ERMSGL], *erp; /* For error messages */
  6138. int n = F_TIME;
  6139. char *s;
  6140. long spdmax;
  6141. #ifdef OS2
  6142. extern int term_io;
  6143. int term_io_sav = term_io;
  6144. #endif /* OS2 */
  6145. char *mmsg = "Sorry, DIAL memory buffer can't be allocated\n";
  6146. /*
  6147. A DIAL command implies a SET MODEM TYPE command and therefore enables
  6148. hanging up by modem commands rather than dropping DTR.
  6149. */
  6150. mdmset = 1; /* See mdmhup() */
  6151. partial = 0;
  6152. if (fc == 3) { /* Partial dial requested */
  6153. partial = 1; /* Set flag */
  6154. fc = 0; /* Treat like regular dialing */
  6155. }
  6156. func_code = fc; /* Make global to this module */
  6157. telnbr = nbr;
  6158. xredial = redial;
  6159. debug(F111,"ckdial entry partial",ckitoa(fc),partial);
  6160. debug(F111,"ckdial entry number",nbr,redial);
  6161. if (fc == 1) { /* ANSWER command? */
  6162. /* Reset caller ID strings */
  6163. if (callid_date) makestr(&callid_date,NULL);
  6164. if (callid_time) makestr(&callid_time,NULL);
  6165. if (callid_name) makestr(&callid_name,NULL);
  6166. if (callid_nmbr) makestr(&callid_nmbr,NULL);
  6167. if (callid_mesg) makestr(&callid_mesg,NULL);
  6168. }
  6169. #ifdef CK_TAPI_X
  6170. if (tttapi && tapipass) {
  6171. if (modemp[n_TAPI] = cktapiGetModemInf()) {
  6172. mymdmtyp = n_TAPI;
  6173. } else {
  6174. mymdmtyp = mdmtyp;
  6175. modemp[n_TAPI] = &GENERIC;
  6176. }
  6177. } else
  6178. #endif /* CK_TAPI */
  6179. mymdmtyp = mdmtyp;
  6180. if (mymdmtyp < 0) { /* Whoa, network dialing... */
  6181. if (mdmsav > -1)
  6182. mymdmtyp = mdmsav;
  6183. }
  6184. if (mymdmtyp < 0) {
  6185. printf("Invalid modem type %d - internal error.\n",mymdmtyp);
  6186. dialsta = DIA_NOMO;
  6187. return(0);
  6188. }
  6189. dial_what = DW_NOTHING; /* Doing nothing at first. */
  6190. nonverbal = 0;
  6191. /* These are ONLY for the purpose of interpreting numeric result codes. */
  6192. is_motorola =
  6193. #ifdef MINIDIAL
  6194. 0
  6195. #else
  6196. mymdmtyp == n_SUPRA || mymdmtyp == n_SUPRASON;
  6197. #endif /* MINIDIAL */
  6198. ;
  6199. is_motorola =
  6200. #ifdef MINIDIAL
  6201. 0
  6202. #else
  6203. mymdmtyp == n_MOTOROLA || mymdmtyp == n_MONTANA;
  6204. #endif /* MINIDIAL */
  6205. ;
  6206. is_rockwell =
  6207. #ifdef MINIDIAL
  6208. 0
  6209. #else
  6210. mymdmtyp == n_RWV32 || mymdmtyp == n_RWV32B ||
  6211. mymdmtyp == n_RWV34 || mymdmtyp == n_RWV90 ||
  6212. mymdmtyp == n_BOCA || mymdmtyp == n_TELEPATH ||
  6213. mymdmtyp == n_CARDINAL || mymdmtyp == n_BESTDATA ||
  6214. mymdmtyp == n_CONEXANT || mymdmtyp == n_PCTEL
  6215. #endif /* MINIDIAL */
  6216. ;
  6217. is_hayeshispd =
  6218. #ifdef MINIDIAL
  6219. 0
  6220. #else
  6221. mymdmtyp == n_H_ULTRA || mymdmtyp == n_H_ACCURA || n_PPI
  6222. #endif /* MINIDIAL */
  6223. ;
  6224. is_supra =
  6225. #ifdef MINIDIAL
  6226. 0
  6227. #else
  6228. mymdmtyp == n_SUPRA || mymdmtyp == n_SUPRAX || n_SUPRASON
  6229. #endif /* MINIDIAL */
  6230. ;
  6231. mp = modemp[mymdmtyp]; /* Set pointer to modem info */
  6232. if (!mp) {
  6233. printf("Sorry, handler for this modem type not yet filled in.\n");
  6234. dialsta = DIA_NOMO;
  6235. return 0;
  6236. }
  6237. debug(F110,"dial number",telnbr,0);
  6238. #ifdef COMMENT
  6239. debug(F110,"dial prefix",(dialnpr ? dialnpr : ""), 0);
  6240. #endif /* COMMENT */
  6241. #ifdef DYNAMIC
  6242. *lbuf = NUL;
  6243. debug(F101,"DIAL lbuf malloc ok","",LBUFL+1);
  6244. if (!rbuf) { /* This one might already have been allocated by getok() */
  6245. if (!(rbuf = malloc(RBUFL+1))) { /* Allocate input line buffer */
  6246. printf("%s", mmsg);
  6247. dialsta = DIA_IE;
  6248. return 0;
  6249. } else
  6250. debug(F101,"DIAL rbuf malloc ok","",RBUFL+1);
  6251. }
  6252. if (!(fbuf = malloc(FULLNUML+1))) { /* Allocate input line buffer */
  6253. printf("%s", mmsg);
  6254. dialsta = DIA_IE;
  6255. if (rbuf) free(rbuf); rbuf = NULL;
  6256. return 0;
  6257. }
  6258. debug(F101,"DIAL fbuf malloc ok","",FULLNUML+1);
  6259. #endif /* DYNAMIC */
  6260. /* NOTE: mdmtyp, not mymdmtyp */
  6261. if (ttopen(ttname,&local,mdmtyp,0) < 0) { /* Open, no carrier wait */
  6262. erp = errmsg;
  6263. if ((int)strlen(ttname) < (ERMSGL - 18)) /* safe, checked */
  6264. sprintf(erp,"Sorry, can't open %s",ttname);
  6265. else
  6266. sprintf(erp,"Sorry, can't open device");
  6267. perror(errmsg);
  6268. dialsta = DIA_OPEN;
  6269. #ifdef DYNAMIC
  6270. if (rbuf) free(rbuf); rbuf = NULL;
  6271. if (fbuf) free(fbuf); fbuf = NULL;
  6272. #endif /* DYNAMIC */
  6273. return 0;
  6274. }
  6275. #ifdef CK_TAPI
  6276. if (!tttapi) {
  6277. #endif /* CK_TAPI */
  6278. /* Condition console terminal and communication line */
  6279. /* Place line into "clocal" dialing state, */
  6280. /* important mainly for System V UNIX. */
  6281. if (ttpkt(speed,FLO_DIAL,parity) < 0) {
  6282. ttclos(0); /* If ttpkt fails do all this... */
  6283. if (ttopen(ttname,&local,mymdmtyp,0) < 0) {
  6284. erp = errmsg;
  6285. if ((int)strlen(ttname) < (ERMSGL - 18)) /* safe, checked */
  6286. sprintf(erp,"Sorry, can't reopen %s",ttname);
  6287. else
  6288. sprintf(erp,"Sorry, can't reopen device");
  6289. perror(errmsg);
  6290. dialsta = DIA_OPEN;
  6291. #ifdef DYNAMIC
  6292. if (rbuf) free(rbuf); rbuf = NULL;
  6293. if (fbuf) free(fbuf); fbuf = NULL;
  6294. #endif /* DYNAMIC */
  6295. return 0;
  6296. } /* And try again. */
  6297. if ((ttpkt(speed,FLO_DIAL,parity) < 0)
  6298. #ifdef UNIX
  6299. && (strcmp(ttname,"/dev/null"))
  6300. #else
  6301. #ifdef OSK
  6302. && (strcmp(ttname,"/nil"))
  6303. #endif /* OSK */
  6304. #endif /* UNIX */
  6305. #ifdef CK_TAPI
  6306. && !tttapi
  6307. #endif /* CK_TAPI */
  6308. ) {
  6309. printf("Sorry, Can't condition communication line\n");
  6310. printf("Try 'set line %s' again\n",ttname);
  6311. dialsta = DIA_OPEN;
  6312. #ifdef DYNAMIC
  6313. if (rbuf) free(rbuf); rbuf = NULL;
  6314. if (fbuf) free(fbuf); fbuf = NULL;
  6315. #endif /* DYNAMIC */
  6316. return 0;
  6317. }
  6318. }
  6319. #ifdef CK_TAPI
  6320. }
  6321. #endif /* CK_TAPI */
  6322. /* Modem's escape sequence... */
  6323. if (dialesc < 0 || dialesc > 127)
  6324. c = NUL;
  6325. else
  6326. c = (char) (dialesc ? dialesc : mp->esc_char);
  6327. mdmcapas = dialcapas ? dialcapas : mp->capas;
  6328. xx_ok = mp->ok_fn; /* Pointer to response reader */
  6329. if (mdmcapas & CKD_AT) { /* Hayes compatible */
  6330. escbuf[0] = c;
  6331. escbuf[1] = c;
  6332. escbuf[2] = c;
  6333. escbuf[3] = NUL;
  6334. /* In case this modem type is user-defined */
  6335. if (!xx_ok) xx_ok = getok;
  6336. } else { /* Other */
  6337. escbuf[0] = c;
  6338. escbuf[1] = NUL;
  6339. /* In case user-defined */
  6340. if (mdmcapas & CKD_V25) if (!xx_ok) xx_ok = getok;
  6341. }
  6342. /* Partial dialing */
  6343. if (mdmcapas & CKD_AT
  6344. #ifndef MINIDIAL
  6345. || mymdmtyp == n_MICROCOM
  6346. #endif /* MINIDIAL */
  6347. ) {
  6348. int x;
  6349. x = (int) strlen(telnbr);
  6350. if (x > 0) {
  6351. if (telnbr[x-1] == ';') {
  6352. partial = 1;
  6353. debug(F110,"ckdial sets partial=1:",telnbr,0);
  6354. } else if (partial) {
  6355. ckmakmsg(fbuf,FULLNUML,telnbr,";",NULL,NULL); /* add one */
  6356. telnbr = fbuf;
  6357. }
  6358. }
  6359. }
  6360. msleep(500);
  6361. debug(F101,"ckdial dialtmo","",dialtmo); /* Timeout */
  6362. if (fc == 1) { /* ANSWER */
  6363. waitct = (dialatmo > -1) ? dialatmo : 0;
  6364. } else { /* DIAL */
  6365. if (dialtmo < 1) { /* Automatic computation. */
  6366. #ifdef CK_TAPI
  6367. if (tttapi && !tapipass) {
  6368. waitct = 1 * (int)strlen(telnbr) ; /* Worst case dial time */
  6369. waitct += 60; /* dialtone + completion wait times */
  6370. for (s = telnbr; *s; s++) { /* add in pause characters time */
  6371. if (*s == ',') {
  6372. waitct += 2; /* unless it was changed in the modem */
  6373. } else if (*s == 'W' ||
  6374. *s == 'w' ||
  6375. *s == '$' ||
  6376. *s == '@'
  6377. ) {
  6378. waitct += 8;
  6379. }
  6380. }
  6381. } else {
  6382. #endif /* CK_TAPI */
  6383. waitct = 1 * (int)strlen(telnbr) ;
  6384. /* dialtone + completion wait times */
  6385. waitct += mp->dial_time;
  6386. for (s = telnbr; *s; s++) {
  6387. for (p = mp->pause_chars; *p; p++)
  6388. if (*s == *p) {
  6389. waitct += mp->pause_time;
  6390. break;
  6391. }
  6392. }
  6393. #ifdef CK_TAPI
  6394. }
  6395. #endif /* CK_TAPI */
  6396. } else {
  6397. waitct = dialtmo; /* User-specified timeout */
  6398. }
  6399. debug(F101,"ckdial waitct A","",waitct);
  6400. }
  6401. /*
  6402. waitct is our alarm() timer.
  6403. mdmwait is how long we tell the modem to wait for carrier.
  6404. We set mdmwait to be 5 seconds less than waitct, to increase the
  6405. chance that we get a response from the modem before timing out.
  6406. */
  6407. if (waitct <= 0) { /* 0 or negative means wait forever */
  6408. #ifdef COMMENT
  6409. waitct = 254; /* These were backwards in 7.0.196 */
  6410. mdmwait = 0;
  6411. #else
  6412. waitct = 0; /* Fixed in 7.0.198. */
  6413. mdmwait = 254;
  6414. #endif /* COMMENT */
  6415. } else {
  6416. if (dialtmo < 1) { /* Automatic computation. */
  6417. #ifdef XWAITCT
  6418. /* Addtl wait slop can be defined at compile time */
  6419. waitct += XWAITCT;
  6420. #endif /* XWAITCT */
  6421. if (waitct < 60 + mdmwaitd)
  6422. waitct = 60 + mdmwaitd;
  6423. }
  6424. if (mdmcapas & CKD_AT) { /* AT command-set modems */
  6425. mdmwait = waitct; /* S7 timeout = what user asked for */
  6426. waitct += mdmwaitd; /* Kermit timeout a bit later */
  6427. } else { /* Non-AT */
  6428. mdmwait = waitct; /* no difference */
  6429. }
  6430. }
  6431. debug(F101,"ckdial waitct B","",waitct);
  6432. if (fc == 1) { /* ANSWER */
  6433. #ifdef COMMENT
  6434. /*
  6435. This is wrong. mdmwait is the value given to S7 in Hayeslike modems.
  6436. When in autoanswer mode, this is the amount of time the modem waits for
  6437. carrier once ringing starts. Whereas waitct is the timeout given to the
  6438. ANSWER command, which is an entirely different thing. Since the default
  6439. ANSWER timeout is 0 (meaning "wait forever"), the following statement sets
  6440. S7 to 0, which, on some modems (like the USR Sportster) makes it hang up
  6441. and report NO CARRIER the instant the phone rings.
  6442. */
  6443. mdmwait = waitct;
  6444. #else
  6445. if (mdmwait <= 0)
  6446. mdmwait = 60; /* Always wait 60 seconds. */
  6447. #endif /* COMMENT */
  6448. }
  6449. if (!quiet && !backgrd) { /* Print information messages. */
  6450. #ifdef VMS
  6451. printf(" \n");
  6452. fflush(stdout);
  6453. #endif /* VMS */
  6454. if (fc == 1)
  6455. printf(" Waiting for phone call...\n");
  6456. else
  6457. printf(" %srying: %s...\n", x1 > 0 ? "Ret" : "T", telnbr);
  6458. if (x1 == 0 && x2 == 0 && dialsta != DIA_PART) {
  6459. if (network) {
  6460. printf(" Via modem server: %s, modem: %s\n",
  6461. ttname, gmdmtyp() );
  6462. } else {
  6463. #ifdef CK_TAPI
  6464. if (tttapi && !tapipass)
  6465. printf(" Device: %s, modem: %s", ttname, "TAPI" );
  6466. else
  6467. #endif /* CK_TAPI */
  6468. printf(" Device: %s, modem: %s",
  6469. ttname, gmdmtyp() );
  6470. if (speed > -1L)
  6471. printf(", speed: %ld\n", speed);
  6472. else
  6473. printf(", speed: (unknown)\n");
  6474. }
  6475. spdmax = dialmax > 0L ? dialmax : mp->max_speed;
  6476. #ifndef NOHINTS
  6477. if (hints && !quiet &&
  6478. !network && spdmax > 0L && speed > spdmax
  6479. #ifdef CK_TAPI
  6480. && (!tttapi || tapipass)
  6481. #endif /* CK_TAPI */
  6482. ) {
  6483. printf("\n*************************\n");
  6484. printf(
  6485. "Interface speed %ld might be too high for this modem type.\n",
  6486. speed
  6487. );
  6488. printf(
  6489. "If dialing fails, SET SPEED to %ld or less and try again.\n",
  6490. spdmax
  6491. );
  6492. printf("(Use SET HINTS OFF to suppress future hints.)\n");
  6493. printf("*************************\n");
  6494. printf("\n");
  6495. }
  6496. #endif /* NOHINTS */
  6497. printf(" %s timeout: ", fc == 0 ? "Dial" : "Answer");
  6498. if (waitct > 0)
  6499. printf("%d seconds\n",mdmwait);
  6500. else
  6501. printf(" (none)\n");
  6502. printf(
  6503. #ifdef MAC
  6504. " Type Command-. to cancel.\n"
  6505. #else
  6506. #ifdef UNIX
  6507. " To cancel: type your interrupt character (normally Ctrl-C).\n"
  6508. #else
  6509. " To cancel: type Ctrl-C (hold down Ctrl, press C).\n"
  6510. #endif /* UNIX */
  6511. #endif /* MAC */
  6512. );
  6513. }
  6514. }
  6515. debug(F111,"ckdial",ttname,(int) (speed / 10L));
  6516. debug(F101,"ckdial timeout","",waitct);
  6517. #ifdef OS2
  6518. term_io = 0;
  6519. #endif /* OS2 */
  6520. /* Set timer and interrupt handlers. */
  6521. savint = signal( SIGINT, dialint ) ; /* And terminal interrupt handler. */
  6522. cc_alrm_execute(ckjaddr(sjbuf), 0, dialtime, _dodial, faildial);
  6523. signal(SIGINT, savint);
  6524. #ifdef OS2
  6525. if (dialsta == DIA_OK) /* Dialing is completed */
  6526. DialerSend(OPT_KERMIT_CONNECT, 0);
  6527. term_io = term_io_sav;
  6528. #endif /* OS2 */
  6529. if (dialsta == DIA_PART || dialsta == DIA_OK) {
  6530. /* This is needed, e.g., for Telnet modem servers */
  6531. if (reliable != SET_OFF || !setreliable) {
  6532. reliable = SET_OFF; /* Transport is not reliable */
  6533. debug(F101,"ckdial reliable","",reliable);
  6534. }
  6535. return(1); /* Dial attempt succeeded */
  6536. } else {
  6537. return(0); /* Dial attempt failed */
  6538. }
  6539. } /* ckdial */
  6540. /*
  6541. getok() - wait up to n seconds for OK (0) or ERROR (4) response from modem.
  6542. Use with Hayeslike or CCITT modems for reading the reply to a nondialing
  6543. command.
  6544. Second argument says whether to be strict about numeric result codes, i.e.
  6545. to require they be preceded by CR or else be the first character in the
  6546. response, e.g. to prevent the ATH0<CR> echo from looking like a valid
  6547. response. Strict == 0 is needed for ATI on Telebit, which can return the
  6548. model number concatenated with the numeric response code, e.g. "9620"
  6549. ("962" is the model number, "0" is the response code). getok() Returns:
  6550. 0 if it timed out,
  6551. 1 if it succeeded,
  6552. -1 on modem command, i/o, or other error.
  6553. */
  6554. static ckjmpbuf okbuf;
  6555. static SIGTYP
  6556. #ifdef CK_ANSIC
  6557. oktimo(int foo) /* Alarm handler for getok(). */
  6558. #else
  6559. oktimo(foo) int foo; /* Alarm handler for getok(). */
  6560. #endif /* CK_ANSIC */
  6561. /* oktimo */ {
  6562. #ifdef OS2
  6563. alarm(0);
  6564. /* signal(SIGALRM,SIG_IGN); */
  6565. debug(F100,"oktimo() SIGALRM caught -- SIG_IGN set","",0) ;
  6566. #endif /* OS2 */
  6567. #ifdef OSK /* OS-9, see comment in dialtime(). */
  6568. sigmask(-1);
  6569. #endif /* OSK */
  6570. #ifdef NTSIG
  6571. if ( foo == SIGALRM )
  6572. PostAlarmSigSem();
  6573. else
  6574. PostCtrlCSem();
  6575. #else /* NTSIG */
  6576. #ifdef NT
  6577. cklongjmp(ckjaddr(okbuf),1);
  6578. #else /* NT */
  6579. cklongjmp(okbuf,1);
  6580. #endif /* NTSIG */
  6581. #endif /* NT */
  6582. /* NOTREACHED */
  6583. SIGRETURN;
  6584. }
  6585. static int okstatus, okn, okstrict;
  6586. static SIGTYP
  6587. #ifdef CK_ANSIC
  6588. dook(void * threadinfo)
  6589. #else /* CK_ANSIC */
  6590. dook(threadinfo) VOID * threadinfo ;
  6591. #endif /* CK_ANSIC */
  6592. /* dook */ {
  6593. CHAR c;
  6594. #ifdef DEBUG
  6595. char * mdmmsg = "";
  6596. #endif /* DEBUG */
  6597. int i, x;
  6598. #ifdef IKSD
  6599. extern int inserver;
  6600. #endif /* IKSD */
  6601. #ifdef NTSIG
  6602. signal(SIGINT,oktimo);
  6603. if (threadinfo) { /* Thread local storage... */
  6604. TlsSetValue(TlsIndex,threadinfo);
  6605. }
  6606. #endif /* NTSIG */
  6607. #ifdef CK_LOGIN
  6608. #ifdef NT
  6609. #ifdef IKSD
  6610. if (inserver)
  6611. setntcreds();
  6612. #endif /* IKSD */
  6613. #endif /* NT */
  6614. #endif /* CK_LOGIN */
  6615. if (mdmcapas & CKD_V25) { /* CCITT, easy... */
  6616. waitfor("VAL");
  6617. okstatus = 1;
  6618. debug(F111,"Modem_Response(V25)","VAL",okstatus);
  6619. #ifdef NTSIG
  6620. ckThreadEnd(threadinfo);
  6621. #endif /* NTSIG */
  6622. SIGRETURN;
  6623. #ifndef MINIDIAL
  6624. } else if (mymdmtyp == n_MICROCOM) { /* Microcom in SX mode, also easy */
  6625. waitfor(MICROCOM.wake_prompt); /* (I think...) */
  6626. debug(F111,"Modem_Response(Microcom)",MICROCOM.wake_prompt,okstatus);
  6627. okstatus = 1;
  6628. #ifdef NTSIG
  6629. ckThreadEnd(threadinfo);
  6630. #endif /* NTSIG */
  6631. SIGRETURN;
  6632. #endif /* MINIDIAL */
  6633. } else { /* Hayes & friends, start here... */
  6634. okstatus = 0; /* No status yet. */
  6635. for (x = 0; x < RBUFL; x++) /* Initialize response buffer */
  6636. rbuf[x] = SP; /* to all spaces */
  6637. rbuf[RBUFL] = NUL; /* and terminate with NUL. */
  6638. while (okstatus == 0) { /* While no status... */
  6639. x = ddinc(okn); /* Read a character */
  6640. if (x < 0) { /* I/O error */
  6641. okstatus = -1;
  6642. #ifdef NTSIG
  6643. ckThreadEnd(threadinfo);
  6644. #endif /* NTSIG */
  6645. SIGRETURN;
  6646. }
  6647. #ifdef COMMENT
  6648. /* too much */
  6649. debug(F101,"getok ddinc","",x); /* Got a character. */
  6650. #endif /* COMMENT */
  6651. c = (char) (x & 0x7f); /* Get low order 7 bits */
  6652. if (!c) /* Don't deposit NULs */
  6653. continue; /* or else didweget() won't work */
  6654. if (dialdpy) conoc((char)c); /* Echo it if requested */
  6655. for (i = 0; i < RBUFL-1; i++) /* Rotate buffer */
  6656. rbuf[i] = rbuf[i+1];
  6657. rbuf[RBUFL-1] = c; /* Deposit character at end */
  6658. #ifdef COMMENT
  6659. /* too much */
  6660. debug(F000,"getok:",rbuf,(int) c); /* Log it */
  6661. #endif /* COMMENT */
  6662. switch (c) { /* Interpret it. */
  6663. case CR: /* Got a carriage return. */
  6664. switch(rbuf[RBUFL-2]) { /* Look at character before it. */
  6665. case '0': /* 0 = OK numeric response */
  6666. if (!okstrict ||
  6667. rbuf[RBUFL-3] == CR || rbuf[RBUFL-3] == SP) {
  6668. nonverbal = 1;
  6669. okstatus = 1; /* Good response */
  6670. }
  6671. debug(F111,"Modem_Response(Hayes)","0",okstatus);
  6672. break;
  6673. case '4': /* 4 = ERROR numeric response */
  6674. #ifndef MINIDIAL
  6675. /* Or Telebit model number 964! */
  6676. if (mymdmtyp == n_TELEBIT &&
  6677. isdigit(rbuf[RBUFL-3]) &&
  6678. isdigit(rbuf[RBUFL-4]))
  6679. break;
  6680. else
  6681. #endif /* MINIDIAL */
  6682. if (!okstrict ||
  6683. rbuf[RBUFL-3] == CR || rbuf[RBUFL-3] == SP) {
  6684. nonverbal = 1;
  6685. okstatus = -1; /* Bad command */
  6686. }
  6687. debug(F111,"Modem_Response(Hayes)","4",okstatus);
  6688. break;
  6689. }
  6690. if (dialdpy && nonverbal) /* If numeric results, */
  6691. conoc(LF); /* echo a linefeed too. */
  6692. break;
  6693. case LF: /* Got a linefeed. */
  6694. /*
  6695. Note use of explicit octal codes in the string for
  6696. CR and LF. We want real CR and LF here, not whatever
  6697. the compiler happens to replace \r and \n with...
  6698. */
  6699. if (!strcmp(rbuf+RBUFL-4,"OK\015\012")) { /* Good response */
  6700. okstatus = 1;
  6701. debug(F111,"Modem_Response(Hayes)","OK",okstatus);
  6702. }
  6703. if (!strcmp(rbuf+RBUFL-3,"OK\012")) { /* Good response */
  6704. okstatus = 1;
  6705. debug(F111,"Modem_Response(Hayes)","OK",okstatus);
  6706. } else if (!strcmp(rbuf+RBUFL-7,"ERROR\015\012")) { /* Error */
  6707. okstatus = -1;
  6708. debug(F111,"Modem_Response(Hayes)","ERROR",okstatus);
  6709. } else if (!strcmp(rbuf+RBUFL-6,"ERROR\012")) { /* Error */
  6710. okstatus = -1;
  6711. debug(F111,"Modem_Response(Hayes)","ERROR",okstatus);
  6712. }
  6713. break;
  6714. /* Check whether modem echoes its commands... */
  6715. case 't': /* Got little t */
  6716. if (!strcmp(rbuf+RBUFL-3,"\015at") || /* See if it's "at" */
  6717. !strcmp(rbuf+RBUFL-3," at"))
  6718. mdmecho = 1;
  6719. /* debug(F111,"MDMECHO-t",rbuf+RBUFL-2,mdmecho); */
  6720. break;
  6721. case 'T': /* Got Big T */
  6722. if (!strcmp(rbuf+RBUFL-3,"\015AT") || /* See if it's "AT" */
  6723. !strcmp(rbuf+RBUFL-3," AT"))
  6724. mdmecho = 1;
  6725. /* debug(F111,"MDMECHO-T",rbuf+RBUFL-3,mdmecho); */
  6726. break;
  6727. default: /* Other characters, accumulate. */
  6728. okstatus = 0;
  6729. break;
  6730. }
  6731. }
  6732. }
  6733. debug(F101,"getok","",okstatus); /* <-- It's a lie (why?) */
  6734. #ifdef NTSIG
  6735. ckThreadEnd(threadinfo);
  6736. #endif /* NTSIG */
  6737. SIGRETURN;
  6738. }
  6739. static SIGTYP
  6740. #ifdef CK_ANSIC
  6741. failok(void * threadinfo)
  6742. #else /* CK_ANSIC */
  6743. failok(threadinfo) VOID * threadinfo;
  6744. #endif /* CK_ANSIC */
  6745. /* failok */ {
  6746. debug(F100,"longjmp returned to getok()","",0);
  6747. debug(F100,"getok timeout","",0);
  6748. SIGRETURN;
  6749. }
  6750. int
  6751. getok(n, strict) int n, strict; {
  6752. debug(F101,"getok entry n","",n);
  6753. okstatus = 0;
  6754. okn = n;
  6755. okstrict = strict;
  6756. #ifdef DYNAMIC
  6757. if (!rbuf) {
  6758. if (!(rbuf = malloc(RBUFL+1))) { /* Allocate input line buffer */
  6759. dialsta = DIA_IE;
  6760. return(-1);
  6761. }
  6762. debug(F101,"GETOK rbuf malloc ok","",RBUFL+1);
  6763. }
  6764. #endif /* DYNAMIC */
  6765. mdmecho = 0; /* Assume no echoing of commands */
  6766. debug(F100,"about to alrm_execute dook()","",0);
  6767. alrm_execute( ckjaddr(okbuf), n, oktimo, dook, failok ) ;
  6768. debug(F100,"returning from alrm_execute dook()","",0);
  6769. ttflui(); /* Flush input buffer */
  6770. return(okstatus); /* Return status */
  6771. }
  6772. /* G E T H R N -- Get Hayes Result Numeric */
  6773. static VOID
  6774. gethrn() {
  6775. char c;
  6776. int x;
  6777. /*
  6778. Hayes numeric result codes (Hayes 1200 and higher):
  6779. 0 = OK
  6780. 1 = CONNECT at 300 bps (or 1200 bps on Hayes 1200 with basic code set)
  6781. 2 = RING
  6782. 3 = NO CARRIER
  6783. 4 = ERROR (in command line)
  6784. 5 = CONNECT 1200 (extended code set)
  6785. Hayes 2400 and higher:
  6786. 6 = NO DIALTONE
  6787. 7 = BUSY
  6788. 8 = NO ANSWER
  6789. 9 = (there is no 9)
  6790. 10 = CONNECT 2400
  6791. Reportedly, the codes for Hayes V.32 modems are:
  6792. 1x = CONNECT <suffix>
  6793. 5x = CONNECT 1200 <suffix>
  6794. 9x = CONNECT 2400 <suffix>
  6795. 11x = CONNECT 4800 <suffix>
  6796. 12x = CONNECT 9600 <suffix>
  6797. Where:
  6798. x: suffix:
  6799. R = RELIABLE
  6800. RC = RELIABLE COMPRESSED
  6801. L = LAPM
  6802. LC = LAPM COMPRESSED
  6803. And for Telebits, all the above, except no suffix in numeric mode, plus:
  6804. 11 = CONNECT 4800
  6805. 12 = CONNECT 9600
  6806. 13 = CONNECT 14400
  6807. 14 = CONNECT 19200
  6808. 15 = CONNECT 38400
  6809. 16 = CONNECT 57600
  6810. 20 = CONNECT 300/REL (= MNP)
  6811. 22 = CONNECT 1200/REL (= MNP)
  6812. 23 = CONNECT 2400/REL (= MNP)
  6813. 46 = CONNECT 7512 (i.e. 75/1200)
  6814. 47 = CONNECT 1275 (i.e. 1200/75)
  6815. 48 = CONNECT 7200
  6816. 49 = CONNECT 12000
  6817. 50 = CONNECT FAST (not on T1600/3000)
  6818. 52 = RRING
  6819. 53 = DIALING
  6820. 54 = NO PROMPTTONE
  6821. 61 = CONNECT FAST/KERM (Kermit spoof)
  6822. 70 = CONNECT FAST/COMP (PEP + compression)
  6823. 71 = CONNECT FAST/KERM/COMP (PEP + compression + Kermit spoof)
  6824. And for others, lots of special cases below...
  6825. */
  6826. #define NBUFL 8
  6827. char nbuf[NBUFL+1]; /* Response buffer */
  6828. int i = 0, j = 0; /* Buffer pointers */
  6829. debug(F101,"RESPONSE mdmecho","",mdmecho);
  6830. if (mdmecho) { /* Sponge up dialing string echo. */
  6831. while (1) {
  6832. c = (char) (ddinc(0) & 0x7f);
  6833. debug(F000,"SPONGE","",c);
  6834. dialoc(c);
  6835. if (c == CR) break;
  6836. }
  6837. }
  6838. while (mdmstat == 0) { /* Read response */
  6839. for (i = 0; i < NBUFL; i++) /* Clear the buffer */
  6840. nbuf[i] = '\0';
  6841. i = 0; /* Reset the buffer pointer. */
  6842. c = (char) (ddinc(0) & 0177); /* Get first digit of response. */
  6843. /* using an untimed, blocking read. */
  6844. debug(F000,"RESPONSE-A","",c);
  6845. dialoc(c); /* Echo it if requested. */
  6846. if (!isdigit(c)) /* If not a digit, keep looking. */
  6847. continue;
  6848. nbuf[i++] = c; /* Got first digit, save it. */
  6849. while (c != CR && i < 8) { /* Read chars up to CR */
  6850. x = ddinc(0) & 0177; /* Get a character. */
  6851. c = (char) x; /* Got it OK. */
  6852. debug(F000,"RESPONSE-C","",c);
  6853. if (c != CR) /* If it's not a carriage return, */
  6854. nbuf[i++] = c; /* save it. */
  6855. dialoc(c); /* Echo it. */
  6856. }
  6857. nbuf[i] = '\0'; /* Done, terminate the buffer. */
  6858. debug(F110,"dial hayesnv lbuf",lbuf,0);
  6859. debug(F111,"dial hayesnv got",nbuf,i);
  6860. /*
  6861. Separate any non-numeric suffix from the numeric
  6862. result code with a null.
  6863. */
  6864. for (j = i-1; (j > -1) && !isdigit(nbuf[j]); j--)
  6865. nbuf[j+1] = nbuf[j];
  6866. j++;
  6867. nbuf[j++] = '\0';
  6868. debug(F110,"dial hayesnv numeric",nbuf,0);
  6869. debug(F111,"dial hayesnv suffix ",nbuf+j,j);
  6870. /* Probably phone number echoing. */
  6871. if ((int)strlen(nbuf) > 3)
  6872. continue;
  6873. /* Now read and interpret the results... */
  6874. i = atoi(nbuf); /* Convert to integer */
  6875. switch (i) {
  6876. case 0:
  6877. mdmstat = D_PARTIAL; /* OK response */
  6878. break;
  6879. case 1: /* CONNECT */
  6880. mdmstat = CONNECTED; /* Could be any speed */
  6881. break;
  6882. case 2: /* RING */
  6883. if (dialdpy)
  6884. printf("\r\n Local phone is ringing!\r\n");
  6885. mdmstat = D_FAILED;
  6886. dialsta = DIA_RING;
  6887. break;
  6888. case 3: /* NO CARRIER */
  6889. if (dialdpy) printf("\r\n No Carrier.\r\n");
  6890. mdmstat = D_FAILED;
  6891. dialsta = DIA_NOCA;
  6892. break;
  6893. case 4: /* ERROR */
  6894. if (dialdpy)
  6895. printf("\r\n Modem Command Error.\r\n");
  6896. mdmstat = D_FAILED;
  6897. dialsta = DIA_ERR;
  6898. break;
  6899. case 5: /* CONNECT 1200 */
  6900. spdchg(1200L); /* Change speed if necessary. */
  6901. mdmstat = CONNECTED;
  6902. break;
  6903. case 6: /* NO DIALTONE */
  6904. #ifndef MINIDIAL
  6905. if (mymdmtyp == n_MICROLINK && atoi(diallcc) == 49 && dialdpy)
  6906. printf("\r\n Dial Locked.\r\n"); /* Germany */
  6907. else
  6908. #endif /* MINIDIAL */
  6909. if (dialdpy)
  6910. printf("\r\n No Dialtone.\r\n");
  6911. mdmstat = D_FAILED;
  6912. dialsta = DIA_NODT;
  6913. break;
  6914. case 7: /* BUSY */
  6915. if (dialdpy) printf("\r\n Busy.\r\n");
  6916. mdmstat = D_FAILED;
  6917. dialsta = DIA_BUSY;
  6918. break;
  6919. case 8: /* NO ANSWER */
  6920. #ifndef MINIDIAL
  6921. if (mymdmtyp == n_MICROLINK && atoi(diallcc) == 41 && dialdpy)
  6922. printf("\r\n Dial Locked.\r\n"); /* Switzerland */
  6923. else
  6924. #endif /* MINIDIAL */
  6925. if (dialdpy)
  6926. printf("\r\n No Answer.\r\n");
  6927. mdmstat = D_FAILED;
  6928. dialsta = DIA_NOAN;
  6929. break;
  6930. case 9:
  6931. #ifndef MINIDIAL
  6932. if (mymdmtyp == n_XJACK || mymdmtyp == n_SUPRAX) {
  6933. spdchg(600);
  6934. break;
  6935. } /* fall thru */
  6936. #endif /* MINIDIAL */
  6937. case 10: /* CONNECT 2400 */
  6938. spdchg(2400L); /* Change speed if necessary. */
  6939. mdmstat = CONNECTED;
  6940. break;
  6941. #ifndef MINIDIAL
  6942. /* Starting here, we get different meanings from different manufacturers */
  6943. case 11:
  6944. if (mymdmtyp == n_USR) {
  6945. if (dialdpy) printf(" Ringing...\r\n");
  6946. } else {
  6947. spdchg(4800L); /* CONNECT 4800 */
  6948. mdmstat = CONNECTED;
  6949. }
  6950. break;
  6951. case 12:
  6952. if (mymdmtyp == n_USR) {
  6953. if (dialdpy)
  6954. printf("\r\n Answered by voice.\r\n");
  6955. mdmstat = D_FAILED;
  6956. dialsta = DIA_VOIC;
  6957. } else if (mymdmtyp == n_KEEPINTOUCH) {
  6958. spdchg(7200L);
  6959. mdmstat = CONNECTED;
  6960. } else {
  6961. spdchg(9600L);
  6962. mdmstat = CONNECTED;
  6963. }
  6964. break;
  6965. case 13:
  6966. if (mymdmtyp == n_ATT1900 || mymdmtyp == n_ATT1910) {
  6967. if (dialdpy) printf(" Wait...\r\n");
  6968. break;
  6969. } else if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
  6970. spdchg(9600L);
  6971. else if (is_rockwell || is_supra ||
  6972. mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
  6973. spdchg(7200L);
  6974. else if (mymdmtyp != n_MICROLINK)
  6975. spdchg(14400L);
  6976. mdmstat = CONNECTED;
  6977. break;
  6978. case 14:
  6979. if (is_rockwell || is_supra || mymdmtyp == n_XJACK)
  6980. spdchg(12000L);
  6981. else if (mymdmtyp == n_DATAPORT || mymdmtyp == n_MICROLINK)
  6982. spdchg(14400L);
  6983. else if (mymdmtyp == n_KEEPINTOUCH)
  6984. spdchg(9600L);
  6985. else if (mymdmtyp != n_USR && mymdmtyp != n_ZOLTRIX)
  6986. spdchg(19200L);
  6987. mdmstat = CONNECTED;
  6988. break;
  6989. case 15:
  6990. if (is_rockwell || is_supra ||
  6991. mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
  6992. spdchg(14400L);
  6993. else if (mymdmtyp == n_USR)
  6994. spdchg(1200L);
  6995. else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
  6996. spdchg(7200L);
  6997. else if (mymdmtyp == n_DATAPORT)
  6998. spdchg(19200L);
  6999. else
  7000. spdchg(38400L);
  7001. mdmstat = CONNECTED;
  7002. break;
  7003. case 16:
  7004. if (is_rockwell || is_supra ||
  7005. mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
  7006. spdchg(19200L);
  7007. else if (mymdmtyp == n_USR)
  7008. spdchg(2400L);
  7009. else if (mymdmtyp == n_DATAPORT)
  7010. spdchg(7200L);
  7011. else if (mymdmtyp != n_ZYXEL && mymdmtyp != n_INTEL) /* 12000 */
  7012. spdchg(57600L);
  7013. mdmstat = CONNECTED;
  7014. break;
  7015. case 17:
  7016. if (mymdmtyp != n_DATAPORT || mymdmtyp == n_XJACK) /* 16800 */
  7017. spdchg(38400L);
  7018. else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
  7019. spdchg(14400L);
  7020. else if (mymdmtyp == n_KEEPINTOUCH)
  7021. spdchg(14400L);
  7022. else if (mymdmtyp == n_USR)
  7023. spdchg(9600L);
  7024. mdmstat = CONNECTED;
  7025. break;
  7026. case 18:
  7027. if (is_rockwell || is_supra ||
  7028. mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK ||
  7029. mymdmtyp == n_MHZATT || mymdmtyp == n_LUCENT)
  7030. spdchg(57600L);
  7031. else if (mymdmtyp == n_INTEL)
  7032. spdchg(19200L);
  7033. else if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
  7034. spdchg(4800L);
  7035. mdmstat = CONNECTED;
  7036. break;
  7037. case 19:
  7038. if (mymdmtyp == n_DATAPORT)
  7039. spdchg(300L);
  7040. else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
  7041. spdchg(38400L);
  7042. else
  7043. spdchg(115200L);
  7044. mdmstat = CONNECTED;
  7045. break;
  7046. case 20:
  7047. if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
  7048. spdchg(7200L);
  7049. else if (mymdmtyp == n_DATAPORT)
  7050. spdchg(2400L);
  7051. else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
  7052. spdchg(57600L);
  7053. else
  7054. spdchg(300L);
  7055. mdmstat = CONNECTED;
  7056. break;
  7057. case 21:
  7058. if (mymdmtyp == n_DATAPORT)
  7059. spdchg(4800L);
  7060. mdmstat = CONNECTED;
  7061. break;
  7062. case 22:
  7063. if (is_rockwell || is_supra || mymdmtyp == n_XJACK)
  7064. spdchg(8880L);
  7065. else if (mymdmtyp == n_DATAPORT)
  7066. spdchg(9600L);
  7067. else if (mymdmtyp == n_KEEPINTOUCH)
  7068. spdchg(300L);
  7069. else if (!is_hayeshispd)
  7070. spdchg(1200L);
  7071. mdmstat = CONNECTED;
  7072. break;
  7073. case 23:
  7074. if (is_hayeshispd || is_supra ||
  7075. mymdmtyp == n_MULTI || mymdmtyp == n_XJACK)
  7076. spdchg(8880L);
  7077. else if (mymdmtyp != n_DATAPORT && !is_rockwell) /* 12000 */
  7078. spdchg(2400L);
  7079. mdmstat = CONNECTED;
  7080. break;
  7081. case 24:
  7082. if (is_rockwell || is_supra || mymdmtyp == n_XJACK) {
  7083. mdmstat = D_FAILED;
  7084. dialsta = DIA_DELA; /* Delayed */
  7085. break;
  7086. } else if (is_hayeshispd || mymdmtyp == n_LUCENT)
  7087. spdchg(7200L);
  7088. else if (mymdmtyp == n_DATAPORT)
  7089. spdchg(14400L);
  7090. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7091. spdchg(1200L);
  7092. mdmstat = CONNECTED;
  7093. break;
  7094. case 25:
  7095. if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
  7096. spdchg(14400L);
  7097. else if (mymdmtyp == n_LUCENT)
  7098. spdchg(12000L);
  7099. else if (is_motorola)
  7100. spdchg(9600L);
  7101. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7102. spdchg(2400L);
  7103. mdmstat = CONNECTED;
  7104. break;
  7105. case 26:
  7106. if (mymdmtyp == n_DATAPORT)
  7107. spdchg(19200L);
  7108. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7109. spdchg(4800L);
  7110. mdmstat = CONNECTED;
  7111. break;
  7112. case 27:
  7113. if (mymdmtyp == n_DATAPORT)
  7114. spdchg(38400L);
  7115. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7116. spdchg(7200L);
  7117. else if (mymdmtyp == n_MHZATT)
  7118. spdchg(8880L);
  7119. mdmstat = CONNECTED;
  7120. break;
  7121. case 28:
  7122. if (mymdmtyp == n_DATAPORT)
  7123. spdchg(7200L);
  7124. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7125. spdchg(9600L);
  7126. else if (mymdmtyp == n_MHZATT || mymdmtyp == n_LUCENT)
  7127. spdchg(38400L);
  7128. mdmstat = CONNECTED;
  7129. break;
  7130. case 29:
  7131. if (is_motorola)
  7132. spdchg(4800L);
  7133. else if (mymdmtyp == n_DATAPORT)
  7134. spdchg(19200L);
  7135. mdmstat = CONNECTED;
  7136. break;
  7137. case 30:
  7138. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7139. spdchg(14400L);
  7140. mdmstat = CONNECTED;
  7141. } /* fall thru on purpose... */
  7142. case 31:
  7143. if (mymdmtyp == n_UCOM_AT || mymdmtyp == n_MICROLINK) {
  7144. spdchg(4800L);
  7145. mdmstat = CONNECTED;
  7146. } else if (is_motorola) {
  7147. spdchg(57600L);
  7148. mdmstat = CONNECTED;
  7149. }
  7150. break;
  7151. case 32:
  7152. if (is_rockwell || is_supra || mymdmtyp == n_XJACK) {
  7153. mdmstat = D_FAILED;
  7154. dialsta = DIA_BLCK; /* Blacklisted */
  7155. } else if (mymdmtyp == n_UCOM_AT || mymdmtyp == n_MICROLINK) {
  7156. spdchg(9600L);
  7157. mdmstat = CONNECTED;
  7158. } else if (mymdmtyp == n_KEEPINTOUCH) {
  7159. spdchg(300L);
  7160. mdmstat = CONNECTED;
  7161. } else if (mymdmtyp == n_INTEL) {
  7162. spdchg(2400L);
  7163. mdmstat = CONNECTED;
  7164. }
  7165. break;
  7166. case 33: /* FAX connection */
  7167. if (is_rockwell || is_supra ||
  7168. mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK) {
  7169. mdmstat = D_FAILED;
  7170. dialsta = DIA_FAX;
  7171. } else if (mymdmtyp == n_UCOM_AT ||
  7172. is_motorola ||
  7173. mymdmtyp == n_MICROLINK
  7174. ) {
  7175. spdchg(9600L);
  7176. mdmstat = CONNECTED;
  7177. } else if (mymdmtyp == n_MHZATT) {
  7178. spdchg(115200L);
  7179. mdmstat = CONNECTED;
  7180. }
  7181. break;
  7182. case 34:
  7183. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7184. spdchg(1200L);
  7185. mdmstat = CONNECTED;
  7186. } else if (mymdmtyp == n_MICROLINK) {
  7187. spdchg(7200L);
  7188. mdmstat = CONNECTED;
  7189. }
  7190. break;
  7191. case 35:
  7192. if (is_rockwell) {
  7193. spdchg(300L);
  7194. dialsta = CONNECTED;
  7195. } else if (is_motorola) {
  7196. spdchg(14400L);
  7197. mdmstat = CONNECTED;
  7198. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7199. spdchg(2400L);
  7200. mdmstat = CONNECTED;
  7201. } else if (mymdmtyp == n_MICROLINK) {
  7202. spdchg(7200L);
  7203. mdmstat = CONNECTED;
  7204. } else if (mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK) /* DATA */
  7205. mdmstat = CONNECTED;
  7206. break;
  7207. case 36:
  7208. if (mymdmtyp == n_UCOM_AT) {
  7209. spdchg(19200L);
  7210. mdmstat = CONNECTED;
  7211. } else if (is_motorola) {
  7212. spdchg(1200L);
  7213. mdmstat = CONNECTED;
  7214. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7215. spdchg(4800L);
  7216. mdmstat = CONNECTED;
  7217. }
  7218. break;
  7219. case 37:
  7220. if (mymdmtyp == n_UCOM_AT) {
  7221. spdchg(19200L);
  7222. mdmstat = CONNECTED;
  7223. } else if (is_motorola) {
  7224. spdchg(2400L);
  7225. mdmstat = CONNECTED;
  7226. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7227. spdchg(7200L);
  7228. mdmstat = CONNECTED;
  7229. }
  7230. break;
  7231. case 38:
  7232. if (is_motorola) {
  7233. spdchg(4800L);
  7234. mdmstat = CONNECTED;
  7235. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7236. spdchg(9600L);
  7237. mdmstat = CONNECTED;
  7238. } /* fall thru on purpose... */
  7239. case 39:
  7240. if (mymdmtyp == n_UCOM_AT) {
  7241. spdchg(38400L);
  7242. mdmstat = CONNECTED;
  7243. } else if (is_motorola) {
  7244. spdchg(9600L);
  7245. mdmstat = CONNECTED;
  7246. } else if (mymdmtyp == n_MICROLINK) {
  7247. spdchg(14400L);
  7248. mdmstat = CONNECTED;
  7249. }
  7250. break;
  7251. case 40:
  7252. if (mymdmtyp == n_UCOM_AT) {
  7253. mdmstat = D_FAILED;
  7254. dialsta = DIA_NOCA;
  7255. } else if (is_motorola || mymdmtyp == n_INTEL ||
  7256. mymdmtyp == n_KEEPINTOUCH) {
  7257. spdchg(14400L);
  7258. mdmstat = CONNECTED;
  7259. }
  7260. break;
  7261. case 41:
  7262. if (is_motorola) {
  7263. spdchg(19200L);
  7264. mdmstat = CONNECTED;
  7265. }
  7266. break;
  7267. case 42:
  7268. if (mymdmtyp == n_KEEPINTOUCH) {
  7269. spdchg(300L);
  7270. mdmstat = CONNECTED;
  7271. } else if (is_motorola) {
  7272. spdchg(38400L);
  7273. mdmstat = CONNECTED;
  7274. } /* fall thru on purpose... */
  7275. case 43:
  7276. if (mymdmtyp == n_UCOM_AT) {
  7277. spdchg(57600L);
  7278. mdmstat = CONNECTED;
  7279. } else if (mymdmtyp == n_USRX2)
  7280. mdmstat = CONNECTED; /* 168000 */
  7281. break;
  7282. case 44:
  7283. if (is_rockwell) {
  7284. spdchg(8800L);
  7285. dialsta = CONNECTED;
  7286. } else if (is_motorola) {
  7287. spdchg(7200L);
  7288. mdmstat = CONNECTED;
  7289. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7290. spdchg(1200L);
  7291. mdmstat = CONNECTED;
  7292. }
  7293. break;
  7294. case 45:
  7295. if (is_motorola) {
  7296. spdchg(57600L);
  7297. mdmstat = CONNECTED;
  7298. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7299. spdchg(2400L);
  7300. mdmstat = CONNECTED;
  7301. } else if (n_USR) {
  7302. spdchg(14400L);
  7303. mdmstat = CONNECTED;
  7304. }
  7305. break;
  7306. case 46:
  7307. if (is_rockwell)
  7308. spdchg(1200L);
  7309. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7310. spdchg(4800L);
  7311. else
  7312. spdchg(8880L); /* 75/1200 split speed */
  7313. mdmstat = CONNECTED;
  7314. break;
  7315. case 47:
  7316. if (is_rockwell)
  7317. spdchg(2400L);
  7318. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7319. spdchg(7200L);
  7320. else
  7321. printf("CONNECT 1200/75 - Not supported by C-Kermit\r\n");
  7322. mdmstat = CONNECTED;
  7323. break;
  7324. case 48:
  7325. if (is_rockwell)
  7326. spdchg(4800L);
  7327. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7328. spdchg(9600L);
  7329. else
  7330. spdchg(7200L);
  7331. mdmstat = CONNECTED;
  7332. break;
  7333. case 49:
  7334. if (is_rockwell)
  7335. spdchg(7200L);
  7336. mdmstat = CONNECTED;
  7337. break;
  7338. case 50: /* CONNECT FAST */
  7339. if (is_rockwell)
  7340. spdchg(9600L);
  7341. else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
  7342. spdchg(14400L);
  7343. mdmstat = CONNECTED;
  7344. break;
  7345. case 51:
  7346. if (mymdmtyp == n_UCOM_AT) {
  7347. mdmstat = D_FAILED;
  7348. dialsta = DIA_NODT;
  7349. }
  7350. break;
  7351. case 52: /* RRING */
  7352. if (mymdmtyp == n_TELEBIT)
  7353. if (dialdpy) printf(" Ringing...\r\n");
  7354. break;
  7355. case 53: /* DIALING */
  7356. if (mymdmtyp == n_TELEBIT)
  7357. if (dialdpy) printf(" Dialing...\r\n");
  7358. break;
  7359. case 54:
  7360. if (is_rockwell) {
  7361. spdchg(19200L);
  7362. mdmstat = CONNECTED;
  7363. } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7364. spdchg(1200L);
  7365. mdmstat = CONNECTED;
  7366. } else if (mymdmtyp == n_TELEBIT) {
  7367. if (dialdpy) printf("\r\n No Prompttone.\r\n");
  7368. mdmstat = D_FAILED;
  7369. dialsta = DIA_NODT;
  7370. }
  7371. break;
  7372. case 55:
  7373. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7374. spdchg(2400L);
  7375. mdmstat = CONNECTED;
  7376. }
  7377. break;
  7378. case 56:
  7379. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7380. spdchg(4800L);
  7381. mdmstat = CONNECTED;
  7382. }
  7383. break;
  7384. case 57:
  7385. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7386. spdchg(7200L);
  7387. mdmstat = CONNECTED;
  7388. }
  7389. break;
  7390. case 58:
  7391. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7392. spdchg(9600L);
  7393. mdmstat = CONNECTED;
  7394. }
  7395. break;
  7396. case 59:
  7397. if (mymdmtyp == n_INTEL) /* 12000 */
  7398. mdmstat = CONNECTED;
  7399. break;
  7400. case 60:
  7401. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7402. spdchg(14400L);
  7403. mdmstat = CONNECTED;
  7404. }
  7405. break;
  7406. case 64:
  7407. if (mymdmtyp == n_INTEL) {
  7408. spdchg(1200L);
  7409. mdmstat = CONNECTED;
  7410. } else if (is_supra) {
  7411. spdchg(28800L);
  7412. mdmstat = CONNECTED;
  7413. }
  7414. break;
  7415. case 65:
  7416. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7417. spdchg(2400L);
  7418. mdmstat = CONNECTED;
  7419. }
  7420. break;
  7421. case 66:
  7422. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7423. spdchg(4800L);
  7424. mdmstat = CONNECTED;
  7425. }
  7426. break;
  7427. case 67:
  7428. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7429. spdchg(7200L);
  7430. mdmstat = CONNECTED;
  7431. }
  7432. break;
  7433. case 68:
  7434. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7435. spdchg(9600L);
  7436. mdmstat = CONNECTED;
  7437. }
  7438. break;
  7439. case 69:
  7440. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) /* 12000 */
  7441. mdmstat = CONNECTED;
  7442. break;
  7443. case 70:
  7444. if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
  7445. spdchg(14400L);
  7446. mdmstat = CONNECTED;
  7447. }
  7448. break;
  7449. case 73:
  7450. if (mymdmtyp == n_UCOM_AT) {
  7451. spdchg(115200L);
  7452. mdmstat = CONNECTED;
  7453. break;
  7454. } /* else fall thru */
  7455. if (mymdmtyp == n_TELEBIT) /* Early models only */
  7456. mdmstat = CONNECTED;
  7457. break;
  7458. case 85:
  7459. if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
  7460. spdchg(19200L);
  7461. mdmstat = CONNECTED;
  7462. break;
  7463. case 91: /* 21600 */
  7464. case 99: /* 24000 */
  7465. case 103: /* 26400 */
  7466. if (mymdmtyp == n_USRX2)
  7467. mdmstat = CONNECTED;
  7468. break;
  7469. case 107:
  7470. if (mymdmtyp == n_USR || mymdmtyp == n_USRX2) {
  7471. spdchg(28800L);
  7472. mdmstat = CONNECTED;
  7473. }
  7474. break;
  7475. case 151: /* 312000 */
  7476. case 155: /* 336000 */
  7477. if (mymdmtyp == n_USRX2)
  7478. mdmstat = CONNECTED;
  7479. break;
  7480. #endif /* MINIDIAL */
  7481. default:
  7482. #ifndef MINIDIAL
  7483. if (mymdmtyp == n_USR || mymdmtyp == n_USRX2 ||
  7484. is_hayeshispd || is_rockwell)
  7485. #endif /* MINIDIAL */
  7486. if (i > 12) /* There are hundreds of them... */
  7487. mdmstat = CONNECTED;
  7488. break;
  7489. }
  7490. }
  7491. if (mdmstat == CONNECTED && nbuf[j] != '\0') {
  7492. if (dialdpy) {
  7493. printf("\r\n");
  7494. if (nbuf[j] == 'R') printf(" RELIABLE");
  7495. if (nbuf[j] == 'L') printf(" LAPM");
  7496. if (nbuf[j+1] == 'C') printf(" COMPRESSED");
  7497. printf("\r\n");
  7498. }
  7499. ckstrncpy(lbuf,nbuf,LBUFL); /* (for messages...) */
  7500. }
  7501. }
  7502. static VOID /* Get Hayes Result in Word mode */
  7503. gethrw() {
  7504. char *cptr, *s;
  7505. long conspd;
  7506. if (mdmspd && !network) {
  7507. s = lbuf;
  7508. while (*s != '\0' && *s != 'C') s++;
  7509. cptr = (*s == 'C') ? s : NULL;
  7510. conspd = 0L;
  7511. if ((cptr != NULL) && !strncmp(cptr,"CONNECT ",8)) {
  7512. if ((int)strlen(cptr) < 9) /* Just CONNECT, */
  7513. conspd = 300L; /* use 300 bps */
  7514. else if (isdigit(*(cptr+8))) /* not CONNECT FAST */
  7515. conspd = atol(cptr + 8); /* CONNECT nnnn */
  7516. if (conspd != speed) {
  7517. if ((conspd / 10L) > 0) {
  7518. if (ttsspd((int) (conspd / 10L)) < 0) {
  7519. printf(" Can't change speed to %ld\r\n",
  7520. conspd);
  7521. } else {
  7522. speed = conspd;
  7523. mdmstat = CONNECTED;
  7524. if ( !quiet && !backgrd )
  7525. printf(" Speed changed to %ld\r\n",
  7526. conspd);
  7527. }
  7528. }
  7529. } /* Expanded to handle any conceivable speed */
  7530. }
  7531. }
  7532. #ifndef MINIDIAL
  7533. if (mymdmtyp == n_TELEBIT) {
  7534. if (didweget(lbuf,"CONNECT FAST/KERM")) {
  7535. mdmstat = CONNECTED;
  7536. if (dialdpy) printf("FAST/KERM ");
  7537. return;
  7538. }
  7539. }
  7540. #endif /* MINIDIAL */
  7541. if (didweget(lbuf,"RRING") ||
  7542. didweget(lbuf,"RINGING") ||
  7543. didweget(lbuf,"DIALING")) {
  7544. mdmstat = 0;
  7545. } else if (didweget(lbuf,"CONNECT")) {
  7546. mdmstat = CONNECTED;
  7547. } else if (didweget(lbuf,"OK")) {
  7548. if (partial) {
  7549. mdmstat = D_PARTIAL;
  7550. } else {
  7551. mdmstat = D_FAILED;
  7552. dialsta = DIA_ERR;
  7553. }
  7554. } else if (didweget(lbuf,"NO CARRIER")) {
  7555. mdmstat = D_FAILED;
  7556. dialsta = DIA_NOCA;
  7557. } else if (didweget(lbuf,"NO DIALTONE")) {
  7558. mdmstat = D_FAILED;
  7559. dialsta = DIA_NODT;
  7560. } else if (didweget(lbuf,"NO DIAL TONE")) {
  7561. mdmstat = D_FAILED;
  7562. dialsta = DIA_NODT;
  7563. } else if (didweget(lbuf,"BUSY")) {
  7564. mdmstat = D_FAILED;
  7565. dialsta = DIA_BUSY;
  7566. } else if (didweget(lbuf,"NO ANSWER")) {
  7567. mdmstat = D_FAILED;
  7568. dialsta = DIA_NOAN;
  7569. } else if (didweget(lbuf,"VOICE")) {
  7570. mdmstat = D_FAILED;
  7571. dialsta = DIA_VOIC;
  7572. } else if (didweget(lbuf,"VCON")) {
  7573. mdmstat = D_FAILED;
  7574. dialsta = DIA_VOIC;
  7575. } else if (didweget(lbuf,"NO PROMPT TONE")) {
  7576. mdmstat = D_FAILED;
  7577. dialsta = DIA_NODT;
  7578. } else if (didweget(lbuf,"REMOTE ACCESS FAILED")) {
  7579. mdmstat = D_FAILED;
  7580. dialsta = DIA_NOCA;
  7581. } else if (didweget(lbuf,"FAX")) {
  7582. mdmstat = D_FAILED;
  7583. dialsta = DIA_FAX;
  7584. } else if (didweget(lbuf,"WAIT - CONNECTING") ||
  7585. didweget(lbuf,"WAIT-CONNECTING")) { /* AT&T STU-III 19xx */
  7586. mdmstat = 0;
  7587. } else if (didweget(lbuf,"DELAYED")) {
  7588. mdmstat = D_FAILED;
  7589. dialsta = DIA_DELA;
  7590. } else if (didweget(lbuf,"BLACKLISTED")) {
  7591. mdmstat = D_FAILED;
  7592. dialsta = DIA_BLCK;
  7593. } else if (didweget(lbuf,"COMPRESSION")) {
  7594. mdmstat = 0;
  7595. } else if (didweget(lbuf,"PROTOCOL")) {
  7596. mdmstat = 0;
  7597. } else if (didweget(lbuf,"DIAL LOCKED")) { /* Germany, Austria, Schweiz */
  7598. mdmstat = D_FAILED;
  7599. dialsta = DIA_BLCK;
  7600. } else if ( didweget(lbuf,"RING") ||
  7601. didweget(lbuf,"RING1") || /* Distinctive Ring 1 */
  7602. didweget(lbuf,"RING2") || /* Distinctive Ring 2 */
  7603. didweget(lbuf,"RING3") ) {
  7604. mdmstat = (func_code == 0) ? D_FAILED : 0;
  7605. dialsta = DIA_RING;
  7606. } else if (didweget(lbuf,"ERROR")) {
  7607. mdmstat = D_FAILED;
  7608. dialsta = DIA_ERR;
  7609. } else if (didweget(lbuf,"CARRIER")) { /* Boca / Rockwell family */
  7610. #ifdef COMMENT
  7611. if (is_rockwell)
  7612. #endif /* COMMENT */
  7613. mdmstat = 0;
  7614. #ifdef COMMENT
  7615. /* Does CARRIER ever mean the same as CONNECT? */
  7616. else
  7617. mdmstat = CONNECTED;
  7618. #endif /* COMMENT */
  7619. } else if (didweget(lbuf,"DATA")) { /* Boca / Rockwell family */
  7620. /* This message is sent when the modem is in FAX mode */
  7621. /* So setting this to CONNECTED may not be appropriate */
  7622. /* We must send ATO\015 to the modem in response */
  7623. /* Then we will get a CONNECTED message */
  7624. mdmstat = CONNECTED;
  7625. } else if (didweget(lbuf,"DIGITAL LINE")) {
  7626. mdmstat = D_FAILED;
  7627. dialsta = DIA_DIGI;
  7628. } else if (didweget(lbuf,"DATE")) { /* Caller ID Date */
  7629. debug(F110,"CALLID DATE",lbuf,0);
  7630. /* Format is "DATE = MMDD" */
  7631. makestr(&callid_date,lbuf);
  7632. } else if (didweget(lbuf,"TIME")) { /* Caller ID Time */
  7633. /* Format is "TIME = HHMM" */
  7634. debug(F110,"CALLID TIME",lbuf,0);
  7635. makestr(&callid_time,lbuf);
  7636. } else if (didweget(lbuf,"NAME")) { /* Caller ID Name */
  7637. /* Format is "NAME = <listing name>" */
  7638. debug(F110,"CALLID NAME",lbuf,0);
  7639. makestr(&callid_name,lbuf);
  7640. } else if (didweget(lbuf,"NMBR")) { /* Caller ID Number */
  7641. /* Format is "NMBR = <number>, 'P' or 'O'" */
  7642. /* 'P' means Privacy Requested */
  7643. /* 'O' means Out of Service or Not available */
  7644. debug(F110,"CALLID NMBR",lbuf,0);
  7645. makestr(&callid_nmbr,lbuf);
  7646. } else if (didweget(lbuf,"MESG")) { /* Caller ID Unrecognized Message */
  7647. /* Format is "MESG = <tag><length><data><checksum>" */
  7648. debug(F110,"CALLID MESG",lbuf,0);
  7649. makestr(&callid_mesg,lbuf);
  7650. }
  7651. }
  7652. /* Maybe hang up the phone, depending on various SET DIAL parameters. */
  7653. int
  7654. dialhup() {
  7655. int x = 0;
  7656. if (dialhng && dialsta != DIA_PART) { /* DIAL HANGUP ON? */
  7657. x = mdmhup(); /* Try modem-specific method first */
  7658. debug(F101,"dialhup mdmhup","",x);
  7659. if (x > 0) { /* If it worked, */
  7660. dialsta = DIA_HUP;
  7661. if (dialdpy)
  7662. printf(" Modem hangup OK\r\n"); /* fine. */
  7663. } else if (network /* If we're telnetted to */
  7664. #ifdef TN_COMPORT
  7665. && !istncomport() /* (without RFC 2217) */
  7666. #endif /* TN_COMPORT */
  7667. ) {
  7668. dialsta = DIA_HANG;
  7669. if (dialdpy) /* a modem server, just print a msg */
  7670. printf(" WARNING - modem hangup failed\r\n"); /* don't hangup! */
  7671. return(0);
  7672. } else { /* Otherwise */
  7673. x = tthang(); /* Tell the OS to turn off DTR. */
  7674. if (x > 0) { /* Yes, tell results from tthang() */
  7675. dialsta = DIA_HUP;
  7676. if (dialdpy) printf(" Hangup OK\r\n");
  7677. } else if (x == 0) {
  7678. if (dialdpy) printf(" Hangup skipped\r\n");
  7679. } else {
  7680. dialsta = DIA_HANG;
  7681. if (dialdpy) perror(" Hangup error");
  7682. }
  7683. ttflui();
  7684. }
  7685. } else if (dialdpy) printf(" Hangup skipped\r\n"); /* DIAL HANGUP OFF */
  7686. return(x);
  7687. }
  7688. /*
  7689. M D M H U P --
  7690. Sends escape sequence to modem, then sends its hangup command. Returns:
  7691. 0: If modem type is 0 (direct serial connection),
  7692. or if modem type is < 0 (network connection),
  7693. or if no action taken because DIAL MODEM-HANGUP is OFF)
  7694. or because no hangup string for current modem type,
  7695. or C-Kermit is in remote mode,
  7696. or if action taken but there was no positive response from modem;
  7697. 1: Success: modem is in command state and acknowledged the hangup command;
  7698. -1: On modem command error.
  7699. */
  7700. int
  7701. mdmhup() {
  7702. #ifdef MDMHUP
  7703. int m, x = 0;
  7704. int xparity;
  7705. int savcarr;
  7706. extern int ttcarr;
  7707. char *s, *p, c;
  7708. MDMINF * mp = NULL;
  7709. debug(F101,"mdmhup dialmhu","",dialmhu); /* MODEM-HANGUP METHOD */
  7710. debug(F101,"mdmhup local","",local);
  7711. if (dialmhu == 0 || local == 0) /* If DIAL MODEM-HANGUP is OFF, */
  7712. return(0); /* or not in local mode, fail. */
  7713. debug(F101,"mdmhup dialsta","",dialsta);
  7714. debug(F101,"mdmhup mdmset","",mdmset);
  7715. if (dialsta != DIA_OK && !mdmset) /* It's not a dialed connection */
  7716. return(0);
  7717. #ifdef CK_TAPI
  7718. if (tttapi && !tapipass) /* Don't hangup if using TAPI */
  7719. return(0);
  7720. #endif /* CK_TAPI */
  7721. #ifdef COMMENT
  7722. /* No, we still need this for modems that ignore DTR */
  7723. if (mymdmtyp == n_GENERIC && !network)
  7724. return(0);
  7725. #endif /* COMMENT */
  7726. debug(F101,"mdmhup dialesc","",dialesc);
  7727. if (dialesc < 0)
  7728. return(0); /* No modem escape-character, fail. */
  7729. savcarr = ttcarr;
  7730. ttcarr = CAR_OFF;
  7731. x = ttchk();
  7732. ttcarr = savcarr;
  7733. debug(F101,"mdmhup ttchk","",x);
  7734. if (x < 0) /* There appears to be no connection */
  7735. return(0);
  7736. x = 0;
  7737. #ifdef OS2
  7738. /*
  7739. In OS/2, if CARRIER is OFF, and there is indeed no carrier signal, any
  7740. attempt to do i/o at this point can hang the program. This might be true
  7741. for other operating systems too.
  7742. */
  7743. if (!network /* Not a network connection */
  7744. #ifdef TN_COMPORT
  7745. || istncomport()
  7746. #endif /* TN_COMPORT */
  7747. ) {
  7748. m = ttgmdm(); /* Get modem signals */
  7749. if ((m > -1) && (m & BM_DCD == 0)) /* Check for carrier */
  7750. return(0); /* No carrier, skip the rest */
  7751. }
  7752. #endif /* OS2 */
  7753. debug(F111,"mdmhup network",ttname,network);
  7754. debug(F101,"mdmhup mymdmtyp","",mymdmtyp);
  7755. debug(F101,"mdmhup mdmtyp","",mdmtyp);
  7756. /* In case of HANGUP before DIAL */
  7757. if (network && mdmtyp < 1) /* SET HOST but no subsequent */
  7758. return(0); /* SET MODEM TYPE... */
  7759. if (mymdmtyp == 0 && mdmtyp > 0)
  7760. mymdmtyp = mdmtyp;
  7761. if (mymdmtyp < 1) /* Not using a modem */
  7762. return(0);
  7763. if (mymdmtyp > 0) /* An actual modem... */
  7764. mp = modemp[mymdmtyp];
  7765. if (!mp) { /* Get pointer to its MDMINF struct */
  7766. debug(F100,"mdmhup no MDMINF","",0);
  7767. return(0);
  7768. }
  7769. mdmcapas = dialcapas ? dialcapas : mp->capas;
  7770. xx_ok = mp->ok_fn; /* Pointer to response reader */
  7771. s = dialhcmd ? dialhcmd : mp->hup_str; /* Get hangup command */
  7772. if (!s) s = "";
  7773. debug(F110,"mdmhup hup_str",s,0);
  7774. if (!*s) return(0); /* If none, fail. */
  7775. if (ttpkt(speed,FLO_DIAL,parity) < 0) /* Condition line for dialing */
  7776. return(-1);
  7777. xparity = parity; /* Set PARITY to NONE temporarily */
  7778. parity = 0;
  7779. /* In case they gave a SET MODEM ESCAPE command recently... */
  7780. if (dialesc < 0 || dialesc > 127)
  7781. c = NUL;
  7782. else
  7783. c = (char) (dialesc ? dialesc : mp->esc_char);
  7784. if (mdmcapas & CKD_AT) { /* Hayes compatible */
  7785. escbuf[0] = c;
  7786. escbuf[1] = c;
  7787. escbuf[2] = c;
  7788. escbuf[3] = NUL;
  7789. } else { /* Other */
  7790. escbuf[0] = c;
  7791. escbuf[1] = NUL;
  7792. }
  7793. debug(F110,"mdmhup escbuf",escbuf,0);
  7794. if (escbuf[0]) { /* Have escape sequence? */
  7795. debug(F101,"mdmhup esc_time",0,mp->esc_time);
  7796. if (mp->esc_time) /* If we have a guard time */
  7797. msleep(mp->esc_time); /* Pause for guard time */
  7798. debug(F100,"mdmhup pause 1 OK","",0);
  7799. #ifdef NETCONN /* Send modem's escape sequence */
  7800. if (network) { /* Must catch errors here. */
  7801. if (ttol((CHAR *)escbuf,(int)strlen((char *)escbuf)) < 0) {
  7802. parity = xparity;
  7803. return(-1);
  7804. }
  7805. debug(F110,"mdmhup ttslow net ok",escbuf,0);
  7806. } else {
  7807. #endif /* NETCONN */
  7808. ttslow((char *)escbuf,wr); /* Send escape sequence */
  7809. debug(F110,"mdmhup ttslow ok",escbuf,0);
  7810. #ifdef NETCONN
  7811. }
  7812. #endif /* NETCONN */
  7813. if (mp->esc_time) /* Pause for guard time again */
  7814. msleep(mp->esc_time);
  7815. else
  7816. msleep(500); /* Wait half a sec for echoes. */
  7817. debug(F100,"mdmhup pause 1 OK","",0);
  7818. #ifdef COMMENT
  7819. ttflui(); /* Flush response or echo, if any */
  7820. debug(F100,"mdmhup ttflui OK","",0);
  7821. #endif /* COMMENT */
  7822. }
  7823. ttslow(s,wr); /* Now Send hangup string */
  7824. debug(F110,"mdmhup ttslow ok",s,0);
  7825. /*
  7826. This is not exactly right, but it works.
  7827. If we are online:
  7828. the modem says OK when it gets the escape sequence,
  7829. and it says NO CARRIER when it gets the hangup command.
  7830. If we are offline:
  7831. the modem does NOT say OK (or anything else) when it gets the esc sequence,
  7832. but it DOES say OK (and not NO CARRIER) when it gets the hangup command.
  7833. So the following function should read the OK in both cases.
  7834. Of course, this is somewhat Hayes-specific...
  7835. */
  7836. if (xx_ok) { /* Look for OK response */
  7837. debug(F100,"mdmhup calling response function","",0);
  7838. x = (*xx_ok)(3,1); /* Give it 3 seconds, be strict. */
  7839. debug(F101,"mdmhup hangup response","",x);
  7840. msleep(500); /* Wait half a sec */
  7841. ttflui(); /* Get rid of NO CARRIER, if any */
  7842. } else { /* No OK function, */
  7843. x = 1; /* so assume it worked */
  7844. debug(F101,"mdmhup no ok_fn","",x);
  7845. }
  7846. parity = xparity; /* Restore prevailing parity */
  7847. return(x); /* Return OK function's return code. */
  7848. #else /* MDMHUP not defined. */
  7849. debug(F100,"mdmhup MDMHUP not defined","",0);
  7850. return(0); /* Always fail. */
  7851. #endif /* MDMHUP */
  7852. }
  7853. #endif /* NOICP */
  7854. #else /* NODIAL */
  7855. int mdmtyp = 0; /* Default modem type */
  7856. int /* To allow NODIAL versions to */
  7857. mdmhup() { /* call mdmhup(), so calls to */
  7858. return(0); /* mdmhup() need not be within */
  7859. } /* #ifndef NODIAL conditionals */
  7860. #endif /* NODIAL */
  7861. #else
  7862. int mdmtyp = 0; /* Default modem type */
  7863. #endif /* NOLOCAL */