12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249 |
- #include "ckcsym.h"
- char *dialv = "Dial Command, 9.0.161, 4 Feb 2016";
- /* C K U D I A -- Module for automatic modem dialing. */
- /*
- Copyright (C) 1985, 2016,
- Trustees of Columbia University in the City of New York.
- All rights reserved. See the C-Kermit COPYING.TXT file or the
- copyright text in the ckcmai.c module for disclaimer and permissions.
- */
- /*
- Authors:
- Original (version 1, 1985) author: Herm Fischer, Encino, CA.
- Contributed to Columbia University in 1985 for inclusion in C-Kermit 4.0.
- Author and maintainer since 1985: Frank da Cruz, fdc@columbia.edu.
- Contributions by many others throughout the years, including: Jeffrey
- Altman, Mark Berryman, Fernando Cabral, John Chmielewski, Joe Doupnik,
- Richard Hill, Larry Jacobs, Eric Jones, Tom Kloos, Bob Larson, Peter Mauzey,
- Joe Orost, Kevin O'Gorman, Kai Uwe Rommel, Dan Schullman, Warren Tucker, and
- many others.
- */
- /*
- Entry points:
- ckdial(char * number) Dial a number or answer a call
- dialhup() Hang up a dialed connection
- mdmhup() Use modem commands to hang up
- All other routines are static.
- Don't call dialhup() or mdmhup() without first calling ckdial().
- */
- /*
- This module calls externally defined system-dependent functions for
- communications i/o, as described in CKCPLM.DOC, the C-Kermit Program Logic
- Manual, and thus should be portable to all systems that implement those
- functions, and where alarm() and signal() work.
- HOW TO ADD SUPPORT FOR ANOTHER MODEM:
- 1. In ckuusr.h, define a modem-type number symbol (n_XXX) for the new modem,
- the next highest one.
- 2. In ckuusr.h, adjust MAX_MDM to the new number of modem types.
- The remaining steps are in this module:
- 3. Create a MDMINF structure for it. NOTE: The wake_str should include
- all invariant setup info, e.g. enable result codes, BREAK transparency,
- modulation negotiation, etc. See ckcker.h for MDMINF struct definition.
- 4. Add the address of the MDMINF structure to the modemp[] array,
- according to the numerical value of the modem-type number.
- 5. Add the user-visible (SET MODEM) name and corresponding modem number
- to the mdmtab[] array, in alphabetical order by modem-name string.
- 6. If this falls into a class like is_rockwell, is_supra, etc, add the new
- one to the definition of the class.
- 7. Adjust the gethrn() routine to account for any special numeric result
- codes (if it's a Hayes compatible modem).
- 8. Read through the code and add any modem-specific sections as necessary.
- For most modern Hayes-compatible modems, no specific code will be
- needed.
- NOTE: The MINIDIAL symbol is used to build this module to include support
- for only a minimum number of standard and/or generally useful modem types,
- namely Hayes 1200 and 2400, ITU-T (CCITT) V.25bis and V.25ter (V.250),
- Generic-High-Speed, "Unknown", and None. When adding support for a new
- modem type, keep it outside of the MINIDIAL sections unless it deserves to
- be in it.
- */
- #include "ckcdeb.h"
- #ifndef NOLOCAL
- #ifndef NODIAL
- #ifndef NOICP
- #ifndef CK_ATDT
- #define CK_ATDT
- #endif /* CK_ATDT */
- #ifndef NOOLDMODEMS /* Unless instructed otherwise, */
- #define OLDMODEMS /* keep support for old modems. */
- #endif /* NOOLDMODEMS */
- #ifndef M_OLD /* Hide old modem keywords in SET MODEM table. */
- #define M_OLD 0 /* Define as CM_INV to make them invisible. */
- #endif /* M_OLD */
- #ifndef M_ALIAS
- #define M_ALIAS 64
- #endif /* M_ALIAS */
- #ifndef MAC
- #include <signal.h>
- #endif /* MAC */
- #include "ckcasc.h"
- #include "ckcker.h"
- #include "ckucmd.h"
- #include "ckcnet.h"
- #include "ckuusr.h"
- #ifdef OS2ONLY
- #define INCL_VIO /* Needed for ckocon.h */
- #include <os2.h>
- #undef COMMENT
- #include "ckocon.h"
- #endif /* OS2ONLY */
- #ifdef NT
- #include <windows.h>
- #include <tapi.h>
- #include "cknwin.h"
- #include "ckntap.h"
- #endif /* NT */
- #ifdef OS2
- #include "ckowin.h"
- #endif /* OS2 */
- #ifndef ZILOG
- #ifdef NT
- #include <setjmpex.h>
- #else /* NT */
- #include <setjmp.h>
- #endif /* NT */
- #else
- #include <setret.h>
- #endif /* ZILOG */
- #include "ckcsig.h" /* C-Kermit signal processing */
- #ifdef MAC
- #define signal msignal
- #define SIGTYP long
- #define alarm malarm
- #define SIG_IGN 0
- #define SIGALRM 1
- #define SIGINT 2
- SIGTYP (*msignal(int type, SIGTYP (*func)(int)))(int);
- #endif /* MAC */
- #ifdef AMIGA
- #define signal asignal
- #define alarm aalarm
- #define SIGALRM (_NUMSIG+1)
- #define SIGTYP void
- SIGTYP (*asignal(int type, SIGTYP (*func)(int)))(int);
- unsigned aalarm(unsigned);
- #endif /* AMIGA */
- #ifdef STRATUS
- /*
- VOS doesn't have alarm(), but it does have some things we can work with.
- However, we have to catch all the signals in one place to do this, so
- we intercept the signal() routine and call it from our own replacement.
- */
- #define signal vsignal
- #define alarm valarm
- SIGTYP (*vsignal(int type, SIGTYP (*func)(int)))(int);
- int valarm(int interval);
- #ifdef putchar
- #undef putchar
- #endif /* putchar */
- #define putchar(x) conoc(x)
- #ifdef getchar
- #undef getchar
- #endif /* getchar */
- #define getchar(x) coninc(0)
- #endif /* STRATUS */
- #ifdef OS2
- #ifdef putchar
- #undef putchar
- #endif /* putchar */
- #define putchar(x) conoc(x)
- #endif /* OS2 */
- #ifndef NOHINTS
- extern int hints;
- #endif /* NOHINTS */
- #ifdef CK_TAPI
- extern int tttapi;
- extern int tapipass;
- #endif /* CK_TAPI */
- #ifdef CKLOGDIAL
- extern int dialog;
- #endif /* CKLOGDIAL */
- char * dialmsg[] = { /* DIAL status strings */
- /* Keyed to numbers defined in ckcker.h -- keep in sync! */
- "DIAL succeeded", /* 0 DIA_OK */
- "Modem type not specified", /* 1 DIA_NOMO */
- "Communication device not specified", /* 2 DIA_NOLI */
- "Communication device can't be opened", /* 3 DIA_OPEN */
- "Speed not specified", /* 4 DIA_NOSP */
- "Pre-DIAL hangup failed", /* 5 DIA_HANG */
- "Internal error", /* 6 DIA_IE */
- "Device input/output error", /* 7 DIA_IO */
- "DIAL TIMEOUT expired", /* 8 DIA_TIMO */
- "Interrupted by user", /* 9 DIA_INTR */
- "Modem not ready", /* 10 DIA_NRDY */
- "Partial dial OK", /* 11 DIA_PART */
- "Dial directory lookup error", /* 12 DIA_DIR */
- "Hangup OK", /* 13 DIA_HUP */
- NULL, /* 14 (undef) */
- NULL, /* 15 (undef) */
- NULL, /* 16 (undef) */
- NULL, /* 17 (undef) */
- NULL, /* 18 (undef) */
- "No response from modem", /* 19 DIA_NRSP */
- "Modem command error", /* 20 DIA_ERR */
- "Failure to initialize modem", /* 21 DIA_NOIN */
- "Phone busy", /* 22 DIA_BUSY */
- "No carrier", /* 23 DIA_NOCA */
- "No dialtone", /* 24 DIA_NODT */
- "Incoming call", /* 25 DIA_RING */
- "No answer", /* 26 DIA_NOAN */
- "Disconnected", /* 27 DIA_DISC */
- "Answered by voice", /* 28 DIA_VOIC */
- "Access denied / forbidden call", /* 29 DIA_NOAC */
- "Blacklisted", /* 30 DIA_BLCK */
- "Delayed", /* 31 DIA_DELA */
- "Fax connection", /* 32 DIA_FAX */
- "Digital line", /* 33 DIA_DIGI */
- "TAPI dialing failure", /* 34 DIA_TAPI */
- NULL /* 34 */
- };
- #ifdef COMMENT
- #ifdef NOSPL
- static
- #endif /* NOSPL */
- char modemmsg[128] = { NUL, NUL }; /* DIAL response from modem */
- #endif /* COMMENT */
- #ifdef NTSIG
- extern int TlsIndex;
- #endif /* NTSIG */
- int mdmtyp = n_GENERIC; /* Default modem type */
- int mdmset = 0; /* User explicitly set a modem type */
- int /* SET DIAL parameters */
- dialhng = 1, /* DIAL HANGUP, default is ON */
- dialdpy = 0, /* DIAL DISPLAY, default is OFF */
- mdmspd = 0, /* DIAL SPEED-MATCHING (0 = OFF) */
- mdmspk = 1, /* MODEM SPEAKER */
- mdmvol = 2, /* MODEM VOLUME */
- dialtmo = 0, /* DIAL TIMEOUT */
- dialatmo = -1, /* ANSWER TIMEOUT */
- dialksp = 0, /* DIAL KERMIT-SPOOF, 0 = OFF */
- dialidt = 0, /* DIAL IGNORE-DIALTONE */
- #ifndef CK_RTSCTS
- /* If we can't do RTS/CTS then there's no flow control at first. */
- /* So we might easily lose the echo to the init string and the OK */
- /* and then give "No response from modem" errors. */
- dialpace = 150, /* DIAL PACING */
- #else
- dialpace = -1,
- #endif /* CK_RTSCTS */
- /* 0 = RS232 (drop DTR); 1 = MODEM-COMMAND (e.g. <sec>+++<sec>ATH0) */
- dialmhu = DEFMDMHUP; /* MODEM HANGUP-METHOD */
- int
- dialec = 1, /* DIAL ERROR-CORRECTION */
- dialdc = 1, /* DIAL COMPRESSION */
- #ifdef VMS
- /* VMS can only use Xon/Xoff */
- dialfc = FLO_XONX, /* DIAL FLOW-CONTROL */
- #else
- dialfc = FLO_AUTO,
- #endif /* VMS */
- dialmth = XYDM_D, /* DIAL METHOD (Tone, Pulse, Defalt) */
- dialmauto = 1, /* DIAL METHOD is AUTO */
- dialesc = 0; /* DIAL ESCAPE */
- int telephony = 0; /* Command-line '-T' option */
- long dialmax = 0L, /* Modem's max interface speed */
- dialcapas = 0L; /* Modem's capabilities */
- int dialsta = DIA_UNK; /* Detailed return code (ckuusr.h) */
- #ifdef COMMENT
- int ans_cid = 0; /* SET ANSWER parameters */
- int ans_rings = 0; /* (not used yet...) */
- #endif /* COMMENT */
- int is_rockwell = 0;
- int is_motorola = 0;
- int is_supra = 0;
- int is_hayeshispd = 0;
- /* Dialing directory list */
- char *dialdir[MAXDDIR]; /* DIAL DIRECTORY filename array */
- int ndialdir = 0; /* How many dial directories */
- /* User overrides for built-in modem commands */
- char *dialini = NULL; /* MODEM INIT-STRING none */
- char *dialmstr = NULL; /* MODEM DIALMODE-STRING */
- char *dialmprmt = NULL; /* MODEM DIALMODE-PROMPT */
- char *dialcmd = NULL; /* MODEM DIAL-COMMAND, default none */
- char *dialname = NULL; /* Descriptive name for modem */
- char *dialdcon = NULL; /* DC ON command */
- char *dialdcoff = NULL; /* DC OFF command */
- char *dialecon = NULL; /* EC ON command */
- char *dialecoff = NULL; /* EC OFF command */
- char *dialaaon = NULL; /* Autoanswer ON command */
- char *dialaaoff = NULL; /* Autoanswer OFF command */
- char *dialhcmd = NULL; /* Hangup command */
- char *dialhwfc = NULL; /* Hardware flow control command */
- char *dialswfc = NULL; /* (Local) software f.c. command */
- char *dialnofc = NULL; /* No (Local) flow control command */
- char *dialtone = NULL; /* Command to force tone dialing */
- char *dialpulse = NULL; /* ..to force pulse dialing */
- char *dialx3 = NULL; /* Ignore dialtone */
- char *mdmname = NULL;
- char *dialspon = NULL; /* Speaker On command */
- char *dialspoff = NULL; /* Speaker Off command */
- char *dialvol1 = NULL; /* Volume Low command */
- char *dialvol2 = NULL; /* Volume Medium command */
- char *dialvol3 = NULL; /* Volume High command */
- char *dialini2 = NULL; /* Second init string */
- /* Phone number options */
- char *dialnpr = NULL; /* DIAL PREFIX, ditto */
- char *diallac = NULL; /* DIAL LOCAL-AREA-CODE, ditto */
- char *diallcc = NULL; /* DIAL LOCAL-COUNTRY-CODE, ditto */
- char *dialixp = NULL; /* DIAL INTL-PREFIX */
- char *dialixs = NULL; /* DIAL INTL-SUFFIX */
- char *dialldp = NULL; /* DIAL LD-PREFIX */
- char *diallds = NULL; /* DIAL LD-SUFFIX */
- char *diallcp = NULL; /* DIAL LOCAL-PREFIX */
- char *diallcs = NULL; /* DIAL LOCAL-SUFFIX */
- char *dialpxi = NULL; /* DIAL PBX-INTERNAL-PREFIX */
- char *dialpxo = NULL; /* DIAL PBX-OUTSIDE-PREFIX */
- char *dialsfx = NULL; /* DIAL SUFFIX */
- char *dialtfp = NULL; /* DIAL TOLL-FREE-PREFIX */
- char *callid_date = NULL; /* Caller ID strings */
- char *callid_time = NULL;
- char *callid_name = NULL;
- char *callid_nmbr = NULL;
- char *callid_mesg = NULL;
- extern char * d_name;
- extern char * dialtfc[]; /* DIAL TOLL-FREE-AREA-CODE */
- extern char * dialpxx[]; /* DIAL PBX-EXCHANGE */
- extern int ntollfree;
- extern int ndialpxx;
- extern char * dialpucc[]; /* DIAL Pulse countries */
- extern int ndialpucc;
- extern char * dialtocc[]; /* DIAL Tone countries */
- extern int ndialtocc;
- char *dialmac = NULL; /* DIAL macro */
- /* Countries where pulse dialing must be used (tone is not available) */
- static char * pulsecc[] = { NULL }; /* (Unknown at present) */
- /* Countries where tone dialing may safely be the default. */
- /* "+" marks countries where pulse is also allowed. */
- /* Both Pulse and Tone are allowed in Austria & Switzerland but it is not */
- /* yet known if Tone is universally in those countries. */
- static char * tonecc[] = {
- "1", /* + North American Numbering Plan */
- "31", /* Netherlands */
- "32", /* Belgium */
- "33", /* France */
- "352", /* Luxembourg */
- "353", /* Ireland */
- "354", /* Iceland */
- "358", /* Finland */
- "39", /* Italy */
- "44", /* + UK */
- "45", /* Denmark */
- "46", /* Sweden */
- "47", /* Norway */
- "49", /* + Germany */
- NULL
- };
- #ifndef MINIDIAL
- /*
- Telebit model codes:
- ATI Model Numbers Examples
- --- ------------- --------
- 123 Telebit in "total Hayes-1200" emulation mode
- 960 Telebit in Conventional Command (Hayes) mode
- 961 RA12C IBM PC internal original Trailblazer
- 962 RA12E External original Trailblazer
- 963 RM12C Rackmount original Trailblazer
- 964 T18PC IBM PC internal Trailblazer-Plus (TB+)
- 965 T18SA, T2SAA, T2SAS External TB+, T1600, T2000, T3000, WB, and later
- 966 T18RMM Rackmount TB+
- 967 T2MC IBM PS/2 internal TB+
- 968 T1000 External T1000
- 969 ? Qblazer
- 970 Qblazer Plus
- 971 T2500 External T2500
- 972 T2500 Rackmount T2500
- */
- /* Telebit model codes */
- #define TB_UNK 0 /* Unknown Telebit model */
- #define TB_BLAZ 1 /* Original TrailBlazer */
- #define TB_PLUS 2 /* TrailBlazer Plus */
- #define TB_1000 3 /* T1000 */
- #define TB_1500 4 /* T1500 */
- #define TB_1600 5 /* T1600 */
- #define TB_2000 6 /* T2000 */
- #define TB_2500 7 /* T2500 */
- #define TB_3000 8 /* T3000 */
- #define TB_QBLA 9 /* Qblazer */
- #define TB_WBLA 10 /* WorldBlazer */
- #define TB__MAX 10 /* Highest number */
- char *tb_name[] = { /* Array of model names */
- "Unknown", /* TB_UNK */
- "TrailBlazer", /* TB_BLAZ */
- "TrailBlazer-Plus", /* TB_PLUS */
- "T1000", /* TB_1000 */
- "T1500", /* TB_1500 */
- "T1600", /* TB_1600 */
- "T2000", /* TB_2000 */
- "T2500", /* TB_2500 */
- "T3000", /* TB_3000 */
- "Qblazer", /* TB_QBLA */
- "WorldBlazer", /* TB_WBLA */
- ""
- };
- #endif /* MINIDIAL */
- extern int flow, local, mdmtyp, quiet, backgrd, parity, seslog, network;
- extern int carrier, duplex, mdmsav, reliable, setreliable;
- extern int ttnproto, nettype;
- extern long speed;
- extern char ttname[], sesfil[];
- #ifndef NOXFER
- extern CHAR stchr;
- extern int interrupted;
- #endif /* NOXFER */
- /* Failure codes */
- #define F_TIME 1 /* timeout */
- #define F_INT 2 /* interrupt */
- #define F_MODEM 3 /* modem-detected failure */
- #define F_MINIT 4 /* cannot initialize modem */
- #ifndef CK_TAPI
- static
- #endif /* CK_TAPI */
- #ifdef OS2
- volatile
- #endif /* OS2 */
- int fail_code = 0; /* Default failure reason. */
- static int xredial = 0;
- static int func_code; /* 0 = dialing, nonzero = answering */
- static int partial;
- static int mymdmtyp = 0;
- #define DW_NOTHING 0 /* What we are doing */
- #define DW_INIT 1
- #define DW_DIAL 2
- static int dial_what = DW_NOTHING; /* Nothing at first. */
- static int nonverbal = 0; /* Hayes in numeric response mode */
- static MDMINF * mp;
- static CHAR escbuf[6];
- static long mdmcapas;
- _PROTOTYP (static VOID dreset, (void) );
- _PROTOTYP (static int (*xx_ok), (int,int) );
- _PROTOTYP (static int ddinc, (int) );
- _PROTOTYP (int dialhup, (void) );
- _PROTOTYP (int getok, (int,int) );
- _PROTOTYP (char * ck_time, (void) );
- _PROTOTYP (static VOID ttslow, (char *, int) );
- #ifdef COMMENT
- _PROTOTYP (static VOID xcpy, (char *, char *, unsigned int) );
- #endif /* COMMENT */
- _PROTOTYP (static VOID waitfor, (char *) );
- _PROTOTYP (static VOID dialoc, (char) );
- _PROTOTYP (static int didweget, (char *, char *) );
- _PROTOTYP (static VOID spdchg, (long) );
- _PROTOTYP (static int dialfail, (int) );
- _PROTOTYP (static VOID gethrw, (void) );
- _PROTOTYP (static VOID gethrn, (void) );
- int dialudt = n_UDEF; /* Number of user-defined type */
- /* BEGIN MDMINF STRUCT DEFINITIONS */
- /*
- Declare structures containing modem-specific information.
- REMEMBER that only the first SEVEN characters of these names are
- guaranteed to be unique.
- First declare the three types that are allowed for MINIDIAL versions.
- */
- static
- MDMINF CCITT = /* CCITT / ITU-T V.25bis autodialer */
- /*
- According to V.25bis:
- . Even parity is required for giving commands to the modem.
- . Commands might or might not echo.
- . Responses ("Indications") from the modem are terminated by CR and LF.
- . Call setup is accomplished by:
- - DTE raises DTR (V.24 circuit 108) [ttopen() does this]
- - Modem raises CTS (V.24 circuit 106) [C-Kermit ignores this]
- - DTE issues a call request command ("CRN")
- - Modem responds with "VAL" ("command accepted")
- - If the call is completed:
- modem responds with "CNX" ("call connected");
- modem turns CTS (106) OFF;
- modem turns DSR (107) ON;
- else:
- modem responds with "CFI <parameter>" ("call failure indication").
- . To clear a call, the DTE turns DTR (108) OFF.
- . There is no mention of the Carrier Detect circuit (109) in the standard.
- . There is no provision for "escaping back" to the modem's command mode.
- It is not known whether there exists in real life a pure V.25bis modem.
- If there is, this code has never been tested on it. See the Digitel entry.
- */
- {
- "Any CCITT / ITU-T V.25bis conformant modem",
- "", /* pulse command */
- "", /* tone command */
- 40, /* dial_time -- programmable -- */
- ",:", /* pause_chars -- "," waits for programmable time */
- /* ":" waits for dial tone */
- 10, /* pause_time (seconds, just a guess) */
- "", /* wake_str (none) */
- 200, /* wake_rate (msec) */
- "VAL", /* wake_prompt */
- "", /* dmode_str (none) */
- "", /* dmode_prompt (none) */
- "CRN%s\015", /* dial_str */
- 200, /* dial_rate (msec) */
- 0, /* No esc_time */
- 0, /* No esc_char */
- "", /* No hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "CIC\015", /* aa_on_str */
- "DIC\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- CKD_V25, /* capas */
- NULL /* No ok_fn */
- };
- static
- MDMINF HAYES = /* Hayes 2400 and compatible modems */
- {
- "Hayes Smartmodem 2400 and compatibles",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1&S0&C1&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0&S1\015", /* wake_str */
- #else
- "ATQ0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str, user supplies D or T */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 2400L, /* max_speed */
- CKD_AT, /* capas */
- getok /* ok_fn */
- };
- /*
- The intent of the "unknown" modem is to allow KERMIT to support
- unknown modems by having the user type the entire autodial sequence
- (possibly including control characters, etc.) as the "phone number".
- The protocol and other characteristics of this modem are unknown, with
- some "reasonable" values being chosen for some of them. The only way to
- detect if a connection is made is to look for carrier.
- */
- static
- MDMINF UNKNOWN = /* Information for "Unknown" modem */
- {
- "Unknown", /* name */
- "", /* pulse command */
- "", /* tone command */
- 30, /* dial_time */
- "", /* pause_chars */
- 0, /* pause_time */
- "", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- #ifndef MINIDIAL
- static
- MDMINF ATTISN = /* AT&T ISN Network */
- {
- "", /* pulse command */
- "", /* tone command */
- "AT&T ISN Network",
- 30, /* Dial time */
- "", /* Pause characters */
- 0, /* Pause time */
- "\015\015\015\015", /* Wake string */
- 900, /* Wake rate */
- "DIAL", /* Wake prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF ATTMODEM = /* information for AT&T switched-network modems */
- /* "Number" following "dial" can include: p's and
- * t's to indicate pulse or tone (default) dialing,
- * + for wait for dial tone, , for pause, r for
- * last number dialed, and, except for 2224B, some
- * comma-delimited options like o12=y, before number.
- * "Important" options for the modems:
- *
- * All: Except for 2224B, enable option 12 for "transparent
- * data," o12=y. If a computer port used for both
- * incoming and outgoing calls is connected to the
- * modem, disable "enter interactive mode on carriage
- * return," EICR. The Kermit "dial" command can
- * function with EIA leads standard, EIAS.
- *
- * 2212C: Internal hardware switches at their default
- * positions (four rockers down away from numbers)
- * unless EICR is not wanted (rocker down at the 4).
- * For EIAS, rocker down at the 1.
- *
- * 2224B: Front-panel switch position 1 must be up (at the 1,
- * closed). Disable EICR with position 2 down.
- * For EIAS, position 4 down.
- * All switches on the back panel down.
- *
- * 2224CEO: All front-panel switches down except either 5 or 6.
- * Enable interactive flow control with o16=y.
- * Select normal asynchronous mode with o34=0 (zero).
- * Disable EICR with position 3 up. For EIAS, 1 up.
- * Reset the modem after changing switches.
- *
- * 2296A: If option 00 (zeros) is present, use o00=0.
- * Enable interactive flow control with o16=y.
- * Select normal asynchronous mode with o34=0 (zero).
- * (available in Microcom Networking version, but
- * not necessarily other models of the 2296A).
- * Enable modem-port flow control (if available) with
- * o42=y. Enable asynchronous operation with o50=y.
- * Disable EICR with o69=n. For EIAS, o66=n, using
- * front panel.
- */
- {
- "AT&T switched-network modems",
- "", /* pulse command */
- "", /* tone command */
- 20, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- "+", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "at%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- CKD_AT, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF ATTDTDM = /* AT&T Digital Terminal Data Module */
- /* For dialing: KYBD switch down, others usually up. */
- {
- "AT&T Digital Terminal Data Module",
- "", /* pulse command */
- "", /* tone command */
- 20, /* dial_time */
- "", /* pause_chars */
- 0, /* pause_time */
- "", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF DIGITEL = /* Digitel DT-22 CCITT variant used in Brazil */
- /*
- Attempts to adhere strictly to the V.25bis specification do not produce good
- results in real life. The modem for which this code was developed: (a)
- ignores parity; (b) sometimes terminates responses with LF CR instead of CR
- LF; (c) has a Hayes-like escape sequence; (d) supports a hangup ("HUP")
- command. Information from Fernando Cabral in Brasilia.
- */
- {
- "Digitel DT-22 CCITT dialer",
- "", /* pulse command */
- "", /* tone command */
- 40, /* dial_time -- programmable -- */
- ",:", /* pause_chars -- "," waits for programmable time */
- /* ":" waits for dial tone */
- 10, /* pause_time (seconds, just a guess) */
- "HUP\015", /* wake_str (Not Standard CCITT) */
- 200, /* wake_rate (msec) */
- "VAL", /* wake_prompt */
- "", /* dmode_str (none) */
- "", /* dmode_prompt (none) */
- "CRN%s\015", /* dial_str */
- 200, /* dial_rate (msec) */
- 1100, /* esc_time (Not Standard CCITT) */
- 43, /* esc_char (Not Standard CCITT) */
- "HUP\015", /* hup_str (Not Standard CCITT) */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "CIC\015", /* aa_on_str */
- "DIC\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- CKD_V25, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF H_1200 = /* Hayes 1200 and compatible modems */
- {
- "Hayes Smartmodem 1200 and compatibles",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1\015", /* wake_str */
- #else
- "ATQ0\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 1200L, /* max_speed */
- CKD_AT, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF H_ULTRA = /* Hayes high-speed */
- {
- "Hayes Ultra/Optima/Accura 96/144/288", /* U,O,A */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1X4N1Y0&S0&C1&D2S37=0S82=128\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4N1Y0&S1S37=0S82=128\015", /* wake_str */
- #else
- "ATQ0X4N1Y0S37=0S82=128\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */ /* OK for U,O */
- "AT&K4\015", /* swfc_str */ /* OK for U,O */
- "AT&K0\015", /* nofc_str */ /* OK for U,O */
- "AT&Q5S36=7S48=7\015", /* ec_on_str */ /* OK for U,O */
- "AT&Q0\015", /* ec_off_str */ /* OK for U,O */
- "ATS46=2\015", /* dc_on_str */
- "ATS46=0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */ /* (varies) */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF H_ACCURA = /* Hayes Accura */
- { /* GUESSING IT'S LIKE ULTRA & OPTIMA */
- "Hayes Accura",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1X4N1Y0&S0&C1&D2S37=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4N1Y0&S1S37=0\015", /* wake_str */
- #else
- "ATQ0X4N1Y0S37=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5S36=7S48=7\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "ATS46=2\015", /* dc_on_str */
- "ATS46=0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */ /* (varies) */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF PPI = /* Practical Peripherals */
- {
- "Practical Peripherals V.22bis or higher with V.42 and V.42bis",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef COMMENT
- /* In newer models S82 (BREAK handling) was eliminated, causing an error. */
- #ifdef OS2
- "ATQ0X4N1&S0&C1&D2S37=0S82=128\015", /* wake_str */
- #else
- "ATQ0X4N1S37=0S82=128\015", /* wake_str */
- #endif /* OS2 */
- #else /* So now we use Y0 instead */
- #ifdef OS2
- "ATE1Q0V1X4N1&S0&C1&D2Y0S37=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4N1Y0&S1S37=0\015", /* wake_str */
- #else
- "ATQ0X4N1Y0S37=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- #endif /* COMMENT */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5S36=7S48=7\015", /* ec_on_str */
- "AT&Q0S36=0S48=128\015", /* ec_off_str */
- "ATS46=2\015", /* dc_on_str */
- "ATS46=0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF DATAPORT = /* AT&T Dataport */
- {
- "AT&T / Paradyne DataPort V.32 or higher",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- /*
- Note: S41=0 (use highest modulation) omitted, since it is not
- supported on the V.32 and lower models. So let's not touch it.
- */
- #ifdef OS2
- "ATQ0E1V1X6&S0&C1&D2&Q0Y0\\K5S78=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X6&S1&Q0Y0\\K5S78=0\015", /* wake_str */
- #else
- "ATQ0E1X6&Q0Y0\\K5S78=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\\X0\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N7\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF UCOM_AT = /* Microcom DeskPorte FAST ES 28.8 */
- {
- "Microcom DeskPorte FAST 28.8",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1X4\\N0F0&S0&C1&D2\\K5\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4F0&S1\\K5\015", /* wake_str */
- #else
- "ATQ0X4F0\\K5\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\015", /* swfc_str */
- "AT\\H0\\Q0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT-J0\015", /* sb_on_str */
- "AT-J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZOOM = /* Zoom Telephonics V.32bis */
- {
- "Zoom Telephonics V.32bis",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1N1W1X4&S0&C1&D2S82=128S95=47\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1N1W1X4&S1S82=128S95=47\015", /* wake_str */
- #else
- "ATQ0E1N1W1X4S82=128S95=47\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5S36=7S48=7\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "ATS46=138\015", /* dc_on_str */
- "ATS46=136\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZYXEL = /* ZyXEL U-Series */
- {
- "ZyXEL U-Series V.32bis or higher",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1&S0&C1&D2&N0X5&Y1\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1&S1&N0X5&Y1\015", /* wake_str */
- #else
- "ATQ0E1&N0X5&Y1\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&H3\015", /* hwfc_str */
- "AT&H4\015", /* swfc_str */
- "AT&H0\015", /* nofc_str */
- "AT&K3\015", /* ec_on_str */
- "AT&K0\015", /* ec_off_str */
- "AT&K4\015", /* dc_on_str */
- "AT&K3\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZOLTRIX = /* Zoltrix */
- {
- "Zoltrix V.32bis and V.34 modems with Rockwell ACI chipset",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1F0W1X4Y0&S0&C1&D2\\K5S82=128S95=41\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1F0W1X4Y0&S1\\K5S82=128S95=41\015", /* wake_str */
- #else
- "ATQ0E1F0W1X4Y0\\K5S82=128S95=41\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "ATS46=138%C3\015", /* dc_on_str */
- "ATS46=136%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\N0\015", /* sb_on_str */
- "AT&Q0\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MOTOROLA = { /* Motorola FasTalk II or Lifestyle */
- /*
- "\E" and "\X" commands removed - Motorola Lifestyle doesn't have them.
- \E0 = Don't echo while online
- \X0 = Process Xon/Xoff but don't pass through
- */
- "Motorola FasTalk II or Lifestyle", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1X4&S0&C1&D2\\K5\\V1\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1\\K5\\V1\015", /* wake_str */
- #else
- "ATQ0E1X4\\K5\\V1\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N6\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF BOCA = /* Boca */
- {
- "BOCA 14.4 Faxmodem",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1F1N1W1&S0&C1&D2\\K5S37=11S82=128S95=47X4\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1F1N1W1&S1\\K5S37=11S82=128S95=47X4\015", /* wake_str */
- #else
- "ATQ0E1F1N1W1\\K5S37=11S82=128S95=47X4\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3S36=7S48=7\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "ATS46=138\015", /* dc_on_str */
- "ATS46=136\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF INTEL = /* Intel */
- {
- "Intel High-Speed Faxmodem",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1Y0X4&S0&C1&D2\\K1\\V2S25=50\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1Y0X4&S1\\K1\\V2S25=50\015", /* wake_str */
- #else
- "ATQ0E1Y0X4\\K1\\V2S25=50\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "ATB1+FCLASS=0\015", /* dmode_str */
- "OK\015", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\G1\\Q3\015", /* hwfc_str */
- "AT\\G1\\Q1\\X0\015", /* swfc_str */
- "AT\\G0\015", /* nofc_str */
- "AT\\J0\\N3\"H3\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MULTITECH = /* Multitech */
- {
- "Multitech MT1432 or MT2834 Series",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- /* #P0 (= no parity) is not listed in the manual for newer models */
- /* so it has been removed from all three copies of the Multitech wake_str */
- #ifdef OS2
- "ATE1Q0V1X4&S0&C1&D2&E8&Q0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1&E8&Q0\015", /* wake_str */
- #else
- "ATQ0E1X4&E8&Q0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&E4&E7&E8&E11&E13\015", /* hwfc_str */
- "AT&E5&E6&E8&E11&E13\015", /* swfc_str */
- "AT&E3&E7&E8&E10&E12\015", /* nofc_str */
- "AT&E1\015", /* ec_on_str */
- "AT&E0\015", /* ec_off_str */
- "AT&E15\015", /* dc_on_str */
- "AT&E14\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT$BA0\015", /* sb_on_str (= "baud adjust off") */
- "AT$BA1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF SUPRA = /* Supra */
- {
- "SupraFAXModem 144 or 288",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1N1W0X4Y0&S0&C1&D2\\K5S82=128\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1N1W0X4Y0&S1\\K5S82=128\015", /* wake_str */
- #else
- "ATQ0E1N1W0X4Y0\\K5S82=128\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\\N3S48=7\015", /* ec_on_str */
- "AT&Q0\\N1\015", /* ec_off_str */
- "AT%C1S46=138\015", /* dc_on_str */
- "AT%C0S46=136\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM\015", /* sp_off_str */
- "ATL\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF SUPRAX = /* Supra Express */
- {
- "Diamond Supra Express V.90",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1W0X4&C1&D2&S0\\K5\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1W0X4&S1\\K5\015", /* wake_str */
- #else
- "ATQ0E1W0X4\\K5\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C2\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM\015", /* sp_off_str */
- "ATL\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 230400L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MAXTECH = /* MaxTech */
- {
- "MaxTech XM288EA or GVC FAXModem",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4Y0&S0&C1&D2&L0&M0\\K5\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4Y0&L0&M0&S1\\K5\015", /* wake_str */
- #else
- "ATQ0E1X4Y0&L0&M0\\K5\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\\X0\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N6\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT\\N6%C1\015", /* dc_on_str */
- "AT\\N6%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ROLM = /* IBM / Siemens / Rolm 8000, 9000, 9751 CBX DCM */
- {
- "IBM/Siemens/Rolm CBX Data Communications Module",
- "", /* pulse command */
- "", /* tone command */
- 60, /* dial_time */
- "", /* pause_chars */
- 0, /* pause_time */
- "\015\015", /* wake_str */
- 50, /* wake_rate */
- "MODIFY?", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "CALL %s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 19200L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF USR = /* USR Courier and Sportster modems */
- {
- "US Robotics Courier, Sportster, or compatible",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&A3&S0&C1&D2&N0&Y3S14=0\015", /* wake_str */
- #else
- #ifdef SUNOS4
- "ATQ0X4&A3&S0&N0&Y3S14=0\015", /* wake_str -- needs &S0 in SunOS */
- #else
- #ifdef VMS
- "ATQ0X4&A3&S1&N0&Y3S14=0\015", /* wake_str -- needs &S1 in VMS */
- #else
- "ATQ0X4&A3&N0&Y3S14=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* SUNOS4 */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&H1&R2&I0\015", /* hwfc_str */
- "AT&H2&R1&I2\015", /* swfc_str */
- "AT&H0&R1&I0\015", /* nofc_str */
- "AT&M4&B1\015", /* ec_on_str */
- "AT&M0\015", /* ec_off_str */
- "AT&K1\015", /* dc_on_str */
- "AT&K0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF USRX2 = /* USR XJ-CC1560 X2 56K */
- {
- "US Robotics / Megahertz CC/XJ-CC1560 X2",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&A3&S0&B2&C1&D2&N0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4&A3&B2&N0&S1\015", /* wake_str */
- #else
- "ATQ0X4&A3&B2&N0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&H1&I0\015", /* hwfc_str */
- "AT&H2&I2\015", /* swfc_str */
- "AT&H0&I0\015", /* nofc_str */
- "AT&M4\015", /* ec_on_str */
- "AT&M0\015", /* ec_off_str */
- "AT&K1\015", /* dc_on_str */
- "AT&K0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT&B1\015", /* sb_on_str */
- "AT&B0\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF OLDTB = /* Old Telebits */
- {
- "Telebit TrailBlazer, T1000, T1500, T2000, T2500",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 60, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "\021AAAAATQ0E1V1X1&S0&C1&D2S12=50S50=0S54=3\015", /* wake_str. */
- #else
- #ifdef VMS
- "\021AAAAATQ0X1S12=50S50=0S54=3\015", /* wake_str. */
- #else
- "\021AAAAATQ0X1&S1S12=50S50=0S54=3\015", /* wake_str. */
- #endif /* VMS */
- #endif /* OS2 */
- 100, /* wake_rate = 100 msec */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str, Note: no T or P */
- 80, /* dial_rate */
- 1100, /* esc_time (guard time) */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "ATS58=2S68=2\015", /* hwfc_str */
- "ATS58=3S68=3S69=0\015", /* swfc_str */
- "ATS58=0S68=0\015", /* nofc_str */
- "ATS66=1S95=2\015", /* ec_on_str */
- "ATS95=0\015", /* ec_off_str */
- "ATS110=1S96=1\015", /* dc_on_str */
- "ATS110=0S96=0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 19200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_TB|CKD_KS, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF NEWTB = /* New Telebits */
- {
- "Telebit T1600, T3000, QBlazer, WorldBlazer, etc.",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 60, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "\021AAAAATQ0E1V1X2&S0&C1&D2S12=50S50=0S61=0S63=0\015", /* wake_str. */
- #else
- #ifdef VMS
- "\021AAAAATQ0X2&S1S12=50S50=0S61=0S63=0\015", /* wake_str. */
- #else
- "\021AAAAATQ0X2S12=50S50=0S61=0S63=0\015", /* wake_str. */
- #endif /* VMS */
- #endif /* OS2 */
- 100, /* wake_rate = 100 msec */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str, Note: no T or P */
- 80, /* dial_rate */
- 1100, /* esc_time (guard time) */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "ATS58=2S68=2\015", /* hwfc_str */
- "ATS58=3S68=3\015", /* swfc_str */
- "ATS58=0S68=0\015", /* nofc_str */
- "ATS180=3\015", /* ec_on_str */
- "ATS180=0\015", /* ec_off_str */
- "ATS190=1\015", /* dc_on_str */
- "ATS190=0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 38400L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_TB|CKD_KS, /* capas */
- getok /* ok_fn */
- };
- #endif /* MINIDIAL */
- static
- MDMINF DUMMY = /* dummy information for modems that are handled elsewhere */
- {
- "(dummy)",
- "", /* pulse command */
- "", /* tone command */
- 30, /* dial_time */
- "", /* pause_chars */
- 0, /* pause_time */
- "", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- #ifndef MINIDIAL
- static
- MDMINF RWV32 = /* Generic Rockwell V.32 */
- {
- "Generic Rockwell V.32 modem", /* ATI3, ATI4, and ATI6 for details */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4Y0&S0&C1&D2%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4Y0&S1%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #else
- "ATQ0X4Y0%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q6\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF RWV32B = /* Generic Rockwell V.32bis */
- {
- "Generic Rockwell V.32bis modem", /* ATI3, ATI4, and ATI6 for details */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4Y0&S0&C1&D2%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4Y0&S1%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #else
- "ATQ0X4Y0%E2\\K5+FCLASS=0N1S37=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "ATS%C1\015", /* dc_on_str */
- "ATS%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF RWV34 = /* Generic Rockwell V.34 Data/Fax */
- {
- "Generic Rockwell V.34 modem", /* ATI3, ATI4, and ATI6 for details */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0V1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0\015", /* wake_str */
- #else
- "ATQ0V1X4Y0&C1&D2%E2\\K5+FCLASS=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "ATS%C3\015", /* dc_on_str */
- "ATS%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF RWV90 = /* Generic Rockwell V.90 Data/Fax */
- {
- "Generic Rockwell V.90 56K modem", /* ATI3, ATI4, and ATI6 for details */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* wake_str */
- #else
- "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MWAVE = /* IBM Mwave */
- {
- "IBM Mwave Adapter",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4Y0&S0&C1&D2&M0&Q0&N1\\K3\\T0%E2S28=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4Y0&M0&S1&Q0&N1&S0\\K3\\T0%E2S28=0\015", /* wake_str */
- #else
- "ATQ0X4Y0&M0&Q0&N1&S0\\K3\\T0%E2S28=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "", /* swfc_str (it doesn't!) */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N7\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1\"H3\015", /* dc_on_str */
- "AT%C0\"H0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF TELEPATH = /* Gateway 2000 Telepath */
- {
- "Gateway 2000 Telepath II 28.8",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&S0&C1&D2&N0&Y2#CLS=0S13=0S15=0S19=0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4&N0&S1&Y1#CLS=0S13=0S15=0S19=0\015", /* wake_str */
- #else
- "ATQ0X4&N0&Y1#CLS=0S13=0S15=0S19=0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&H1&R2\015", /* hwfc_str */
- "AT&H2&I2S22=17S23=19\015", /* swfc_str */
- "AT&H0&I0&R1\015", /* nofc_str */
- "AT&M4&B1\015", /* ec_on_str -- also fixes speed */
- "AT&M0\015", /* ec_off_str */
- "AT&K1\015", /* dc_on_str */
- "AT&K0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF CARDINAL = /* Cardinal - based on Rockwell V.34 */
- {
- "Cardinal MVP288X Series", /* ATI3, ATI4, and ATI6 for details */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4W1Y0%E2&S0&C1&D2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4W1Y0&S1%E2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
- #else
- "ATQ0X4W1Y0%E2\\K5+FCLASS=0+MS=11,1\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5S36=7S48=7\\N3\015", /* ec_on_str */
- "AT&Q0S48=128\\N1\015", /* ec_off_str */
- "ATS46=138%C1\015", /* dc_on_str */
- "ATS46=136%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF LUCENT = /* Lucent Venus or Data/Fax modem */
- {
- "Lucent Venus chipset",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* VMS */
- #else
- "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* All others */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF CONEXANT = /* Conexant family */
- {
- "Conexant family of modems",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1X4&C1&D2&S0%E1+FCLASS=0\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1X4&C1&D2&S1%E1+FCLASS=0\015", /* VMS */
- #else
- "ATQ0V1X4&C1&D2%E1+FCLASS=0\015", /* UNIX etc */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF PCTEL = /* PCTel chipset */
- {
- "PCTel chipset",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5S37=0\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5S37=0\015", /* VMS */
- #else
- "ATQ0V1N1X4Y0&C1&D2%E2\\K5S37=0\015", /* UNIX etc */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZOOMV34 = /* Zoom Telephonics V.34 */
- {
- "Zoom Telephonics V.34",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1W1X4&S0&C1&D2S82=128\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0V1N1W1X4&S1S82=128\015", /* wake_str */
- #else
- "ATQ0V1N1W1X4S82=128S015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015S32=17S33=19", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "ATS%C3\015", /* dc_on_str */
- "ATS%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZOOMV90 = /* ZOOM V.90 */
- {
- "Zoom V.90 56K",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0\015", /* VMS */
- #else
- "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0\015", /* All others */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ZOOMV92 = /* ZOOM V.92 */
- {
- "Zoom V.92 with V.44 compression",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1N1X4Y0&C1&D2&S0%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* K95 */
- #else
- #ifdef VMS
- "ATQ0V1N1X4Y0&C1&D2&S1%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* VMS */
- #else
- "ATQ0V1N1X4Y0&C1&D2%E2\\K5+FCLASS=0S37=0+MS=V92\015", /* All others */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4S32=17S33=19\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT&Q5\015", /* ec_on_str */
- "AT&Q0\015", /* ec_off_str */
- "AT%C1+DCS=1,1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- /*
- Now the "old" modems, all grouped together, and also within
- "if not defined MINIDIAL"...
- */
- #ifdef OLDMODEMS
- static
- MDMINF CERMETEK = /* Information for "Cermetek Info-Mate 212 A" modem */
- {
- "Cermetek Info-Mate 212 A",
- "", /* pulse command */
- "", /* tone command */
- 20, /* dial_time */
- "BbPpTt", /* pause_chars */
- 0, /* pause_time */
- " XY\016R\015", /* wake_str */
- 200, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "\016D '%s'\015", /* dial_str */
- 200, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 1200L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF DF03 = /* information for "DEC DF03-AC" modem */
- {
- "Digital DF03-AC",
- "", /* pulse command */
- "", /* tone command */
- 27, /* dial_time */
- "=", /* pause_chars */
- 15, /* pause_time */
- "\001\002", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "%s", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF DF100 = /* information for "DEC DF100-series" modem */
- /*
- * The telephone "number" can include "P"s and/or "T"s
- * within it to indicate that subsequent digits are
- * to be dialed using pulse or tone dialing. The
- * modem defaults to pulse dialing. You may modify
- * the dial string below to explicitly default all
- * dialing to pulse or tone, but doing so prevents
- * the use of phone numbers that you may have stored
- * in the modem's memory.
- */
- {
- "Digital DF-100",
- "", /* pulse command */
- "", /* tone command */
- 30, /* dial_time */
- "=", /* pause_chars */
- 15, /* pause_time */
- "\001", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "%s#", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF DF200 = /* information for "DEC DF200-series" modem */
- /*
- * The telephone "number" can include "P"s and/or "T"s
- * within it to indicate that subsequent digits are
- * to be dialed using pulse or tone dialing. The
- * modem defaults to pulse dialing. You may modify
- * the dial string below to explicitly default all
- * dialing to pulse or tone, but doing so prevents
- * the use of phone numbers that you may have stored
- * in the modem's memory.
- */
- {
- "Digital DF-200",
- "", /* pulse command */
- "", /* tone command */
- 30, /* dial_time */
- "=W", /* pause_chars */ /* =: second tone; W: 5 secs */
- 15, /* pause_time */ /* worst case */
- "\002", /* wake_str */ /* allow stored number usage */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- #ifdef COMMENT
- "%s!", /* dial_str */
- #else
- " d %s\015",
- #endif /* COMMENT */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF GDC = /* information for "GeneralDataComm 212A/ED" modem */
- {
- "GeneralDataComm 212A/ED",
- "", /* pulse command */
- "", /* tone command */
- 32, /* dial_time */
- "%", /* pause_chars */
- 3, /* pause_time */
- "\015\015", /* wake_str */
- 500, /* wake_rate */
- "$", /* wake_prompt */
- "D\015", /* dmode_str */
- ":", /* dmode_prompt */
- "T%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 1200L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF PENRIL = /* information for "Penril" modem */
- {
- "Penril modem",
- "", /* pulse command */
- "", /* tone command */
- 50, /* dial_time */
- "", /* pause_chars */
- 0, /* pause_time */
- "\015\015", /* wake_str */
- 300, /* wake_rate */
- ">", /* wake_prompt */
- "k\015", /* dmode_str */
- ":", /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF RACAL = /* Racal Vadic VA4492E */
- {
- "Racal Vadic VA4492E",
- "", /* pulse command */
- "", /* tone command */
- 35, /* dial_time (manual says modem is hardwired to 60) */
- "Kk", /* pause_chars */
- 5, /* pause_time */
- "\005\015", /* wake_str, ^E^M */
- 50, /* wake_rate */
- "*", /* wake_prompt */
- "D\015", /* dmode_str */
- "?", /* dmode_prompt */
- "%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 5, /* esc_char, ^E */
- "\003\004", /* hup_str, ^C^D */
- 0, /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF VENTEL = /* Information for Ven-Tel modem */
- {
- "Ven-Tel",
- "", /* pulse command */
- "", /* tone command */
- 20, /* dial_time */
- "%", /* pause_chars */
- 5, /* pause_time */
- "\015\015\015", /* wake_str */
- 300, /* wake_rate */
- "$", /* wake_prompt */
- "K\015", /* dmode_str (was "") */
- "Number to call: ", /* dmode_prompt (was NULL) */
- "%s\015", /* dial_str (was "<K%s\r>") */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- static
- MDMINF CONCORD = /* Info for Condor CDS 220 2400b modem */
- {
- "Concord Condor CDS 220 2400b",
- "", /* pulse command */
- "", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- "\015\015", /* wake_str */
- 20, /* wake_rate */
- "CDS >", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "<D M%s\015>", /* dial_str */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char */
- "", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_off_str */
- "", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 2400L, /* max_speed */
- 0, /* capas */
- NULL /* ok_fn */
- };
- #endif /* OLDMODEMS */
- static
- MDMINF MICROCOM = /* Microcom modems in native SX mode */
- /* (long answer only) */
- {
- "Microcom MNP modems in SX command mode",
- "DP\015", /* pulse command */
- "DT\015", /* tone command */
- 35, /* dial_time */
- ",!@", /* pause_chars (! and @ aren't pure pauses) */
- 3, /* pause_time */
- /*
- The following sets 8 bits, no parity, BREAK passthru, and SE0 disables the
- escape character, which is a single character with no guard time, totally
- unsafe, so we have no choice but to disable it. Especially since, by
- default, it is Ctrl-A, which is Kermit's packet-start character. We would
- change it to something else, which would enable "mdmhup()", but the user
- wouldn't know about it. Very bad. Note: SE1 sets it to Ctrl-A, SE2
- sets it to Ctrl-B, etc (1..31 allowed). Also SE/Q sets it to "Q".
- */
- "SE0;S1P4;SBRK5\015", /* wake_str */
- 100, /* wake_rate */
- "!", /* wake_prompt */
- "", /* dmode_str */
- NULL, /* dmode_prompt */
- "D%s\015", /* dial_str - number up to 39 chars */
- 0, /* dial_rate */
- 0, /* esc_time */
- 0, /* esc_char - we can't use this */
- "", /* hup_str - it's "H" but can't use */
- "SF13\015", /* hwfc_str */
- "SF11\015", /* swfc_str */
- "SF10\015", /* nofc_str */
- "BAOFF;SMAUT\015", /* ec_on_str */
- "BAON;SMDIR\015", /* ec_off_str */
- "COMP1\015", /* dc_on_str */
- "COMP0\015", /* dc_off_str */
- "AA", /* aa_on_str */
- "", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "SA2", /* sp_off_str */
- "SA0", /* sp_on_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 0L, /* max_speed */
- CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW|CKD_KS, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MICROLINK = /* MicroLink ... */
- { /* 14.4TQ,TL,PC;28.8TQ,TQV;2440T/TR */
- "ELSA MicroLink 14.4, 28.8, 33.6 or 56K", /* ELSA GmbH, Aachen */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&S0\\D0&C1&D2\\K5\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4&S1\\K5\015", /* wake_str */
- #else
- "ATQ0X4\\K5\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\\X0\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "\\J0", /* sb_on_str (?) */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ULINKV250 = /* MicroLink V.250 */
- { /* 56Kflex, V.90; V.250 command set */
- "ELSA MicroLink 56K V.250", /* ELSA GmbH, Aachen */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- /* \D0 = DSR & CTS always on but hwfc overrides on CTS. */
- "ATQ0E1V1X4&S0\\D0&C1&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0X4&S1\015", /* wake_str */
- #else
- "ATQ0X4\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT+IFC=2,2\015", /* hwfc_str */
- "AT+IFC=1,1\015", /* swfc_str */
- "AT+IFC=0,0\015", /* nofc_str */
- "AT+ES=3,0\015", /* ec_on_str */
- "AT+ES=1,0\015", /* ec_off_str */
- "AT+DS=3,0,2048,32\015", /* dc_on_str */
- "AT+DS=0,0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str (?) */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- #endif /* MINIDIAL */
- static
- MDMINF ITUTV250 = /* ITU-T V.250 conforming modem */
- {
- "Any ITU-T V.25ter/V.250 conformant modem",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- "ATQ0E1V1X4&C1&D2\015", /* wake_str (no &Sn in V.25) */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT+IFC=2,2\015", /* hwfc_str */
- "AT+IFC=1,1\015", /* swfc_str */
- "AT+IFC=0,0\015", /* nofc_str */
- "AT+ES=3,0,2;+EB=1,0,30\015", /* ec_on_str */
- "AT+ES=0\015", /* ec_off_str */
- "AT+DS=3,0\015", /* dc_on_str */
- "AT+DS=0,0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- #ifndef CK_TAPI
- static
- #endif /* CK_TAPI */
- MDMINF GENERIC = /* Generic high speed ... */
- {
- "Generic high-speed AT command set",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- "", /* wake_str */
- 0, /* wake_rate */
- "", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_on_str */
- "", /* sp_off_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
- getok /* ok_fn */
- };
- #ifndef MINIDIAL
- static
- MDMINF XJACK = /* Megahertz X-Jack */
- {
- "Megahertz X-Jack XJ3144 / CC6144",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4N1&C1&D2\\K5\015", /* wake_str */
- #else
- "ATQ0X4N1\\K5\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3&Q5\015", /* ec_on_str */
- "AT\\N1&Q0\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF SPIRITII = /* QuickComm Spirit II */
- {
- "QuickComm Spirit II",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- "AT&F\015", /* wake_str */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H\015", /* hup_str */
- "AT*F3\015", /* hwfc_str */
- "AT*F2\015", /* swfc_str */
- "AT*F0\015", /* nofc_str */
- "AT*E6\015", /* ec_on_str */
- "AT*E0\015", /* ec_off_str */
- "AT*E9\015", /* dc_on_str */
- "AT*E0\015", /* dc_off_str */
- "ATS0=2\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MONTANA = { /* Motorola Montana */
- "Motorola Montana", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&S0&C1&D2\\K5\\V1\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1\\K5\\V1\015", /* wake_str */
- #else
- "ATQ0E1X4\\K5\\V1\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N4\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF COMPAQ = { /* Compaq Data+Fax Modem */
- "Compaq Data+Fax Modem", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&S0&C1&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1\015", /* wake_str */
- #else
- "ATQ0E1X4\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str (same as &K3) */
- "AT\\Q1\015", /* swfc_str (same as &K4) */
- "AT\\Q0\015", /* nofc_str (same as &K0) */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\N3\015", /* sb_on_str */
- "AT\\N1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL0\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF FUJITSU = { /* Fujitsu */
- "Fujitsu Fax/Modem Adapter", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4&S0&C1&D2\\K5\\N3\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1\\K5\\N3\015", /* wake_str */
- #else
- "ATQ0E1X4\\K5\\N3\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\\Q3\015", /* hwfc_str */
- "AT&K4\\Q1\015", /* swfc_str */
- "AT&K0\\Q0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1", /* dc_on_str */
- "AT%C0", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MHZATT = /* Megahertz AT&T V.34 */
- {
- "Megahertz AT&T V.34",
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4N1&C1&D2\\K5\015", /* wake_str */
- #else
- "ATQ0X4N1\\K5\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N0\015", /* ec_off_str */
- "AT%C1\"H3\015", /* dc_on_str */
- "AT%C0\"H0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF SUPRASON = /* SupraSonic */
- {
- "Diamond SupraSonic 288V+", /* Diamond Multimedia Systems Inc */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1N1W0X4Y0&S0&C1&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1N1W0X4Y0&S1\015", /* wake_str */
- #else
- "ATQ0E1N1W0X4Y0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K\015", /* nofc_str */
- "AT&Q5\\N3S48=7\015", /* ec_on_str */
- "AT&Q0\\N1\015", /* ec_off_str */
- "AT%C3S46=138\015", /* dc_on_str */
- "AT%C0S46=136\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM\015", /* sp_off_str */
- "ATL\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF BESTDATA = /* Best Data */
- {
- "Best Data Fax Modem", /* Best Data Fax Modem */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1N1W0X4Y0&S0&C1&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1N1W0X4Y0&S1\015", /* wake_str */
- #else
- "ATQ0E1N1W0X4Y0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K\015", /* nofc_str */
- "AT&Q6\\N3\015", /* ec_on_str */
- "AT&Q0\\N1\015", /* ec_off_str */
- "AT%C3\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\N3\015", /* sb_on_str */
- "AT\\N0\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ATT1900 = /* AT&T Secure Data STU III 1900 */
- {
- "AT&T Secure Data STU III Model 1900", /* name */
- "", /* pulse command */
- "", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4\015", /* wake_str */
- #else
- "ATQ0E1X4\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_on_str */
- "", /* sp_off_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 9600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_HW, /* capas */
- getok /* ok_fn */
- };
- /*
- Experimentation showed that hardly any of the documented commands did
- anything other that print ERROR. At first there was no communication at
- all at 9600 bps -- turns out the interface speed was stuck at 2400.
- ATS28=130 (given at 2400 bps) allowed it to work at 9600.
- */
- static
- MDMINF ATT1910 = /* AT&T Secure Data STU III 1910 */
- { /* Adds V.32bis, V.42, V.42bis */
- "AT&T Secure Data STU III Model 1910", /* name */
- /* Believe it or not, "ATT" and "ATP" result in ERROR */
- "", /* pulse command */
- "", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0E1V1X4\015", /* wake_str */
- #else
- "ATQ0E1X4\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- #ifdef COMMENT
- /* These are evidently read-only registers */
- "ATS46=138S47=0\015", /* ec_on_str */
- "ATS46=138S47=128\015", /* ec_off_str */
- "ATS46=138S47=0\015", /* dc_on_str */
- "ATS46=138S47=128\015", /* dc_off_str */
- #else
- "",
- "",
- "",
- "",
- #endif /* COMMENT */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_on_str */
- "", /* sp_off_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 9600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF KEEPINTOUCH = /* AT&T KeepinTouch Card Modem */
- {
- "AT&T KeepinTouch V.32bis Card Modem", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- /* This used to include &C1&S0&D2+Q0 but that gives ERROR */
- "ATQ0E1V1X4&S0&C1&D2\\K5\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1\\K5\015", /* wake_str */
- #else
- "ATQ0E1X4\\K5\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\\X0\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N3-J1\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C3\"H3\015", /* dc_on_str */
- "AT%C0\"H0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "ATN0\\J0\015", /* sb_on_str */
- "ATN1\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 57600L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ROLM_AT = /* Rolm data phone with AT command set */
- {
- "Rolm 244PC or 600 Series with AT Command Set",
- "", /* pulse command */
- "", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1\015", /* wake_str */
- #else
- "ATQ0\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATDT%s\015", /* dial_str -- always Tone */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "", /* hwfc_str */
- "", /* swfc_str */
- "", /* nofc_str */
- "", /* ec_on_str */
- "", /* ec_off_str */
- "", /* dc_on_str */
- "", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "", /* sb_on_str */
- "", /* sb_off_str */
- "", /* sp_on_str */
- "", /* sp_off_str */
- "", /* vol1_str */
- "", /* vol2_str */
- "", /* vol3_str */
- "", /* ignoredt */
- "", /* ini2 */
- 19200L, /* max_speed */
- CKD_AT, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF ATLAS = /* Atlas / Newcom ixfC 33.6 */
- {
- "Atlas / Newcom 33600ixfC Data/Fax Modem", /* Name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATZ0&FQ0V1&C1&D2\015", /* wake_str */
- #else
- "ATZ0&FQ0V1\015", /* wake_str */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\"H3\015", /* ec_on_str */
- "AT\"H0\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "ATN0\\J0\015", /* sb_on_str */
- "ATN1\\J1\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF CODEX = { /* Motorola Codex */
- "Motorola Codex 326X Series", /* Name - AT&V to see settings */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- /* &M0=Async (not sync) */
- /* *MM0=Automatic modulation negotiation */
- /* *DE22=Automatic data rate */
- "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0&S0&D2\015", /* wake_str */
- #else
- #ifdef VMS
- "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0&S1\015", /* wake_str */
- #else
- "ATZQ0E1V1X4Y0*DE22*MM0&C1&M0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT*MF1*FL3\015", /* hwfc_str */
- "AT*MF1*FL1\015", /* swfc_str */
- "AT*MF0*FL0\015", /* nofc_str */
- "AT*EC0*SM3*SC0\015", /* ec_on_str */
- "AT*SM0\015", /* ec_off_str */
- "AT*DC1\015", /* dc_on_str */
- "AT*DC0\015", /* dc_off_str */
- "AT*AA5S0=1\015", /* aa_on_str */
- "AT*AA5S0=0\015", /* aa_off_str */
- "AT*SC1\015", /* sb_on_str */
- "AT*SC0\015", /* sb_off_str */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3*BD2\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MT5634ZPX = /* Multitech */
- {
- "Multitech MT5634ZPX", /* name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATE1Q0V1X4&S0&C1&D2&Q0\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0E1X4&S1&Q0\015", /* wake_str */
- #else
- "ATQ0E1X4&Q0\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT&K3\015", /* hwfc_str */
- "AT&K4\015", /* swfc_str */
- "AT&K0\015", /* nofc_str */
- "AT\\N3\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str (NOT SUPPORTED) */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- static
- MDMINF MOTSM56 = /* Motorola SM56 Chipset */
- {
- "Motorola SM56 V.90 chipset", /* name */
- "ATP\015", /* pulse command */
- "ATT\015", /* tone command */
- 35, /* dial_time */
- ",", /* pause_chars */
- 2, /* pause_time */
- #ifdef OS2
- "ATQ0V1X4&S0&C1&D2*MM16\015", /* wake_str */
- #else
- #ifdef VMS
- "ATQ0V1X4&S1&C1&D2*MM16\015", /* wake_str */
- #else
- "ATQ0V1X4&C1&D2*MM16\015", /* wake_str */
- #endif /* VMS */
- #endif /* OS2 */
- 0, /* wake_rate */
- "OK\015", /* wake_prompt */
- "", /* dmode_str */
- "", /* dmode_prompt */
- "ATD%s\015", /* dial_str */
- 0, /* dial_rate */
- 1100, /* esc_time */
- 43, /* esc_char */
- "ATQ0H0\015", /* hup_str */
- "AT\\Q3\015", /* hwfc_str */
- "AT\\Q1\015", /* swfc_str */
- "AT\\Q0\015", /* nofc_str */
- "AT\\N7\015", /* ec_on_str */
- "AT\\N1\015", /* ec_off_str */
- "AT%C1\015", /* dc_on_str */
- "AT%C0\015", /* dc_off_str */
- "ATS0=1\015", /* aa_on_str */
- "ATS0=0\015", /* aa_off_str */
- "AT\\J0\015", /* sb_on_str */
- "AT\\J1\015", /* sb_off_str (NOT SUPPORTED) */
- "ATM1\015", /* sp_on_str */
- "ATM0\015", /* sp_off_str */
- "ATL1\015", /* vol1_str */
- "ATL2\015", /* vol2_str */
- "ATL3\015", /* vol3_str */
- "ATX3\015", /* ignoredt */
- "", /* ini2 */
- 115200L, /* max_speed */
- CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
- getok /* ok_fn */
- };
- #endif /* MINIDIAL */
- /* END MDMINF STRUCT DEFINITIONS */
- /*
- Table to convert modem numbers to MDMINF struct pointers.
- The entries MUST be in ascending order by modem number, without any
- "gaps" in the numbers, and starting from one (1).
- */
- MDMINF *modemp[] = {
- #ifdef MINIDIAL
- NULL, /* 0 */
- &CCITT, /* 1 */
- &HAYES, /* 2 */
- &UNKNOWN, /* 3 */
- &DUMMY, /* 4 */
- &GENERIC, /* 5 */
- &ITUTV250 /* 6 */
- #else /* Not MINIDIAL */
- NULL, /* 0 */
- &ATTDTDM, /* 1 */
- &ATTISN, /* 2 */
- &ATTMODEM, /* 3 */
- &CCITT, /* 4 */
- #ifdef OLDMODEMS
- &CERMETEK, /* 5 */
- &DF03, /* 6 */
- &DF100, /* 7 */
- &DF200, /* 8 */
- &GDC, /* 9 */
- #else
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- #endif /* OLDMODEMS */
- &HAYES, /* 10 */
- #ifdef OLDMODEMS
- &PENRIL, /* 11 */
- &RACAL, /* 12 */
- #else
- NULL,
- NULL,
- #endif /* OLDMODEMS */
- &UNKNOWN, /* 13 */
- #ifdef OLDMODEMS
- &VENTEL, /* 14 */
- &CONCORD, /* 15 */
- #else
- NULL,
- NULL,
- #endif /* OLDMODEMS */
- &DUMMY, /* 16 */
- &ROLM, /* 17 */
- #ifdef OLDMODEMS
- &MICROCOM, /* 18 */
- #else
- NULL,
- #endif /* OLDMODEMS */
- &USR, /* 19 USR Courier and Sportster */
- &OLDTB, /* 20 Old Telebits */
- &DIGITEL, /* 21 Digitel CCITT */
- &H_1200, /* 22 Hayes 1200 */
- &H_ULTRA, /* 23 Hayes Ultra */
- &H_ACCURA, /* 24 Hayes Optima */
- &PPI, /* 25 PPI */
- &DATAPORT, /* 26 Dataport */
- &BOCA, /* 27 Boca */
- &MOTOROLA, /* 28 Motorola UDS MOTOROLA */
- NULL, /* 29 Digicomm */
- NULL, /* 30 Dynalink */
- &INTEL, /* 31 Intel */
- &UCOM_AT, /* 32 Microcom in AT mode */
- &MULTITECH, /* 33 Multitech */
- &SUPRA, /* 34 Supra */
- &ZOLTRIX, /* 35 Zoltrix */
- &ZOOM, /* 36 Zoom */
- &ZYXEL, /* 37 ZyXEL */
- &DUMMY, /* 38 TAPI */
- &NEWTB, /* 39 New-Telebit */
- &MAXTECH, /* 40 MaxTech */
- &DUMMY, /* 41 User-defined */
- &RWV32, /* 42 Rockwell V.32 */
- &RWV32B, /* 43 Rockwell V.32bis */
- &RWV34, /* 44 Rockwell V.34 */
- &MWAVE, /* 45 IBM Mwave */
- &TELEPATH, /* 46 Gateway 2000 Telepath II 28.8 */
- &MICROLINK, /* 47 MicroLink modems */
- &CARDINAL, /* 48 Cardinal */
- &GENERIC, /* 49 Generic high-speed */
- &XJACK, /* 50 Megahertz-Xjack */
- &SPIRITII, /* 51 QuickComm Spirit II */
- &MONTANA, /* 52 Motorola Montana */
- &COMPAQ, /* 53 Compaq Data+Fax */
- &FUJITSU, /* 54 Fujitsu */
- &MHZATT, /* 55 Megahertz AT&T V.34 */
- &SUPRASON, /* 56 Suprasonic */
- &BESTDATA, /* 57 Best Data */
- &ATT1900, /* 58 AT&T Secure Data STU III 1900 */
- &ATT1910, /* 59 AT&T Secure Data STU III 1910 */
- &KEEPINTOUCH, /* 60 AT&T KeepinTouch */
- &USRX2, /* 61 USR XJ-1560 X2 */
- &ROLM_AT, /* 62 Rolm with AT command set */
- &ATLAS, /* 63 Atlas / Newcom */
- &CODEX, /* 64 Motorola Codex */
- &MT5634ZPX, /* 65 Multitech MT5634ZPX */
- &ULINKV250, /* 66 Microlink V.250 56K */
- &ITUTV250, /* 67 Generic ITU-T V.250 */
- &RWV90, /* 68 Rockwell V.90 56K */
- &SUPRAX, /* 69 Diamond Supra Express V.90 */
- &LUCENT, /* 70 Lucent Venus chipset */
- &PCTEL, /* 71 PCTel */
- &CONEXANT, /* 72 Conexant */
- &ZOOMV34, /* 73 Zoom V.34 */
- &ZOOMV90, /* 74 Zoom V.90 */
- &ZOOMV92, /* 75 Zoom V.92 */
- &MOTSM56 /* 76 Motorola SM56 chipset */
- #endif /* MINIDIAL */
- };
- /*
- * Declare modem names and associated numbers for command parsing,
- * and also for doing number-to-name translation.
- *
- * The entries must be in alphabetical order by modem name.
- */
- struct keytab mdmtab[] = {
- #ifndef MINIDIAL
- "3com-usr-megahertz-56k", n_USRX2, CM_INV,
- "acer-v90", n_RWV90, M_ALIAS,
- "atlas-newcom-33600ifxC", n_ATLAS, 0,
- "att-1900-stu-iii", n_ATT1900, 0,
- "att-1910-stu-iii", n_ATT1910, 0,
- "att-7300", n_ATTUPC, 0,
- "att-dataport", n_DATAPORT, 0,
- "att-dtdm", n_ATTDTDM, 0,
- "att-isn", n_ATTISN, 0,
- "att-keepintouch", n_KEEPINTOUCH, 0,
- "att-switched-net", n_ATTMODEM, 0,
- "att7300", n_ATTUPC, CM_INV, /* old name */
- "attdtdm", n_ATTDTDM, CM_INV, /* old name */
- "attisn", n_ATTISN, CM_INV, /* old name */
- "attmodem", n_ATTMODEM, CM_INV, /* old name */
- "bestdata", n_BESTDATA, 0,
- "boca", n_BOCA, 0,
- "cardinal", n_CARDINAL, 0,
- #endif /* MINIDIAL */
- "ccitt-v25bis", n_CCITT, CM_INV, /* Name changed to ITU-T */
- #ifndef MINIDIAL
- #ifdef OLDMODEMS
- "cermetek", n_CERMETEK, M_OLD,
- #endif /* OLDMODEMS */
- "compaq", n_COMPAQ, 0,
- #ifdef OLDMODEMS
- "concord", n_CONCORD, M_OLD,
- #endif /* OLDMODEMS */
- "conexant", n_CONEXANT, 0,
- "courier", n_USR, CM_INV,
- "dataport", n_DATAPORT, CM_INV, /* == att-dataport */
- #ifdef OLDMODEMS
- "df03-ac", n_DF03, M_OLD,
- "df100-series", n_DF100, M_OLD,
- "df200-series", n_DF200, M_OLD,
- #endif /* OLDMODEMS */
- "digitel-dt22", n_DIGITEL, 0,
- #endif /* MINIDIAL */
- "direct", 0, CM_INV, /* Synonym for NONE */
- #ifndef MINIDIAL
- "fujitsu", n_FUJITSU, 0,
- "gateway-telepath", n_TELEPATH, 0,
- #ifdef OLDMODEMS
- "gdc-212a/ed", n_GDC, M_OLD,
- "ge", n_GENERIC, CM_INV|CM_ABR,
- "gen", n_GENERIC, CM_INV|CM_ABR,
- "gendatacomm", n_GDC, CM_INV, /* Synonym for GDC */
- #endif /* OLDMODEMS */
- #endif /* MINIDIAL */
- "gene", n_GENERIC, CM_INV|CM_ABR,
- "generic", n_GENERIC, 0,
- "generic-high-speed",n_GENERIC, CM_INV,
- "h", n_HAYES, CM_INV|CM_ABR,
- "ha", n_HAYES, CM_INV|CM_ABR,
- "hay", n_HAYES, CM_INV|CM_ABR,
- "haye", n_HAYES, CM_INV|CM_ABR,
- "hayes", n_HAYES, CM_INV|CM_ABR, /* Hayes 2400 */
- #ifndef MINIDIAL
- "hayes-1200", n_H_1200, 0,
- #endif /* MINIDIAL */
- "hayes-2400", n_HAYES, 0,
- #ifndef MINIDIAL
- "hayes-high-speed", n_H_ACCURA, 0,
- "hayes-accura", n_H_ACCURA, CM_INV,
- "hayes-optima", n_H_ACCURA, CM_INV,
- "hayes-ultra", n_H_ULTRA, CM_INV,
- "hst-courier", n_USR, CM_INV, /* Synonym for COURIER */
- "intel", n_INTEL, 0,
- #endif /* MINIDIAL */
- "itu-t-v250", n_ITUTV250, 0,
- "itu-t-v25bis", n_CCITT, 0, /* New name for CCITT */
- "itu-t-v25ter/v250",n_ITUTV250, CM_INV,
- #ifndef MINIDIAL
- "lucent", n_LUCENT, 0,
- "maxtech", n_MAXTECH, 0,
- "megahertz-att-v34", n_MHZATT, 0, /* Megahertzes */
- "megahertz-xjack", n_XJACK, CM_INV|CM_ABR,
- "megahertz-xjack-33.6", n_XJACK, 0,
- "megahertz-xjack-56k", n_USRX2, 0, /* 3COM/USR/Megahertz 33.6 PC Card */
- "mi", n_MICROCOM, CM_INV|CM_ABR,
- "mic", n_MICROCOM, CM_INV|CM_ABR,
- "micr", n_MICROCOM, CM_INV|CM_ABR,
- "micro", n_MICROCOM, CM_INV|CM_ABR,
- "microc", n_MICROCOM, CM_INV|CM_ABR,
- "microco", n_MICROCOM, CM_INV|CM_ABR,
- "microcom", n_MICROCOM, CM_INV|CM_ABR,
- "microcom-at-mode", n_UCOM_AT, 0, /* Microcom DeskPorte, etc */
- "microcom-sx-mode", n_MICROCOM, 0, /* Microcom AX,QX,SX, native mode */
- "microlink", n_MICROLINK, 0,
- "microlink-v250", n_ULINKV250, 0,
- "motorola-codex", n_CODEX, 0,
- "motorola-fastalk", n_MOTOROLA, 0,
- "motorola-lifestyle",n_MOTOROLA, 0,
- "motorola-montana", n_MONTANA, 0,
- "motorola-sm56-v90",n_MOTSM56, 0,
- "mt5634zpx", n_MT5634ZPX, 0,
- "multitech", n_MULTI, 0,
- "mwave", n_MWAVE, 0,
- #endif /* MINIDIAL */
- "none", 0, 0,
- #ifndef MINIDIAL
- #ifndef OLDTBCODE
- "old-telebit", n_TELEBIT, 0,
- #endif /* OLDTBCODE */
- "pctel", n_PCTEL, 0,
- #ifdef OLDMODEMS
- "penril", n_PENRIL, M_OLD,
- #endif /* OLDMODEMS */
- "ppi", n_PPI, 0,
- #ifdef OLDMODEMS
- "racalvadic", n_RACAL, M_OLD,
- #endif /* OLDMODEMS */
- "rockwell-v32", n_RWV32, 0,
- "rockwell-v32bis", n_RWV32B, 0,
- "rockwell-v34", n_RWV34, 0,
- "rockwell-v90", n_RWV90, 0,
- "rolm", n_ROLM, CM_INV|CM_ABR,
- "rolm-244pc", n_ROLMAT, 0,
- "rolm-600-series", n_ROLMAT, 0,
- "rolm-dcm", n_ROLM, 0,
- "smartlink-v90", n_USR, M_ALIAS,
- "spirit-ii", n_SPIRITII, 0,
- "sportster", n_USR, M_ALIAS,
- "sup", n_SUPRA, CM_INV|CM_ABR,
- "supr", n_SUPRA, CM_INV|CM_ABR,
- "supra", n_SUPRA, CM_INV|CM_ABR,
- "supra-express-v90",n_SUPRAX, 0,
- "suprafaxmodem", n_SUPRA, 0,
- "suprasonic", n_SUPRASON, 0,
- #ifdef CK_TAPI
- "tapi", n_TAPI, 0,
- #endif /* CK_TAPI */
- "te", n_TBNEW, CM_INV|CM_ABR,
- "tel", n_TBNEW, CM_INV|CM_ABR,
- "telebit", n_TBNEW, 0,
- "telepath", n_TELEPATH, CM_INV,
- #endif /* MINIDIAL */
- "unknown", n_UNKNOWN, 0,
- "user-defined", n_UDEF, 0,
- #ifndef MINIDIAL
- "usr", n_USR, CM_INV|CM_ABR,
- "usr-212a", n_HAYES, CM_INV|M_ALIAS,
- "usr-courier", n_USR, CM_INV,
- "usr-megahertz-56k", n_USRX2, 0,
- "usr-sportster", n_USR, CM_INV,
- "usr-xj1560-x2", n_USRX2, CM_INV,
- "usrobotics", n_USR, 0,
- "v25bis", n_CCITT, CM_INV, /* Name changed to ITU-T */
- #ifdef OLDMODEMS
- "ventel", n_VENTEL, M_OLD,
- #endif /* OLDMODEMS */
- "zoltrix-v34", n_ZOLTRIX, 0,
- "zoltrix-hsp-v90", n_PCTEL, M_ALIAS,
- "zoltrix-hcf-v90", n_ITUTV250, 0,
- "zoo", n_ZOOM, CM_INV|CM_ABR,
- "zoom", n_ZOOM, CM_INV|CM_ABR,
- "zoom-v32bis", n_ZOOM, 0,
- "zoom-v34", n_ZOOMV34, 0,
- "zoom-v90", n_ZOOMV90, 0,
- "zoom-v92", n_ZOOMV92, 0,
- "zyxel", n_ZYXEL, 0,
- #endif /* MINIDIAL */
- "", 0, 0
- };
- int nmdm = (sizeof(mdmtab) / sizeof(struct keytab)) - 1; /* Number of modems */
- #define CONNECTED 1 /* For completion status */
- #define D_FAILED 2
- #define D_PARTIAL 3
- static int tries = 0;
- static int mdmecho = 0; /* Assume modem does not echo */
- static char *p; /* For command strings & messages */
- #define LBUFL 200
- static char lbuf[LBUFL+4];
- char modemmsg[LBUFL+4] = { NUL, NUL }; /* DIAL response from modem */
- #ifdef DYNAMIC
- #define RBUFL 256
- static char *rbuf = NULL;
- #else
- #define RBUFL 63
- static char rbuf[RBUFL+1];
- #endif /* DYNAMIC */
- #ifdef DYNAMIC
- #define FULLNUML 256
- char *fbuf = NULL; /* For full (prefixed) phone number */
- #else
- #define FULLNUML 100
- char fbuf[FULLNUML];
- #endif /* DYNAMIC */
- static ckjmpbuf sjbuf;
- #ifdef CK_ANSIC
- static SIGTYP (*savalrm)(int); /* For saving alarm handler */
- static SIGTYP (*savint)(int); /* For saving interrupt handler */
- #else
- static SIGTYP (*savalrm)(); /* For saving alarm handler */
- static SIGTYP (*savint)(); /* For saving interrupt handler */
- #endif /* CK_ANSIC */
- #ifdef CKLOGDIAL
- static VOID
- dologdial(s) char *s; {
- char buf2[16];
- char * r = NULL;
- int x, m, n;
- extern char cxlogbuf[], uidbuf[], myhost[];
- if (!s) s = "";
- if ((x = strlen(s)) > 0) { /* Replace spaces by underscores */
- r = (char *)malloc(x+1);
- if (r) {
- int i;
- for (i = 0; i <= x; i++) {
- if (s[i] != 0 && s[i] <= SP)
- r[i] = '_';
- else
- r[i] = s[i];
- }
- s = r;
- }
- }
- p = ckdate();
- n = ckstrncpy(cxlogbuf,p,CXLOGBUFL);
- if (!uidbuf[0]) {
- debug(F100,"dologdial uidbuf empty","",0);
- ckstrncpy(uidbuf,(char *)whoami(),UIDBUFLEN);
- }
- m = strlen(uidbuf)+strlen(myhost)+strlen(ttname)+strlen(s)+strlen(buf2)+32;
- if (n+m < CXLOGBUFL-1) {
- p = cxlogbuf+n;
- if (diallcc && diallac) {
- buf2[0] = '+';
- ckmakmsg(&buf2[1],15,diallcc,"(",diallac,")");
- } else {
- ckstrncpy(buf2,"Unknown",16);
- }
- sprintf(p," %s %s T=DIAL H=%s D=%s N=%s O=%s ", /* safe (prechecked) */
- uidbuf,
- ckgetpid(),
- myhost,
- ttname,
- s,
- buf2
- );
- debug(F110,"dologdial cxlogbuf",cxlogbuf,0);
- } else
- sprintf(p,"LOGDIAL BUFFER OVERFLOW");
- if (r) free(r);
- }
- #endif /* CKLOGDIAL */
- #ifndef MINIDIAL
- #ifdef COMMENT
- static VOID
- xcpy(to,from,len) /* Copy the given number of bytes */
- register char *to, *from;
- register unsigned int len; {
- while (len--) *to++ = *from++;
- }
- #endif /* COMMENT */
- #endif /* MINIDIAL */
- static SIGTYP
- #ifdef CK_ANSIC
- dialtime(int foo) /* Timer interrupt handler */
- #else
- dialtime(foo) int foo; /* Timer interrupt handler */
- #endif /* CK_ANSIC */
- /* dialtime */ {
- fail_code = F_TIME; /* Failure reason = timeout */
- debug(F100,"dialtime caught SIGALRM","",0);
- #ifdef BEBOX
- #ifdef BE_DR_7
- alarm_expired();
- #endif /* BE_DR_7 */
- #endif /* BEBOX */
- #ifdef OS2
- signal(SIGALRM, dialtime);
- #endif /* OS2 */
- #ifdef __EMX__
- signal(SIGALRM, SIG_ACK); /* Needed for OS/2 */
- #endif /* __EMX__ */
- #ifdef OSK /* OS-9 */
- /*
- We are in an intercept routine but do not perform a F$RTE (done implicitly
- by RTS), so we have to decrement the sigmask as F$RTE does. Warning:
- longjump only restores the CPU registers, NOT the FPU registers. So, don't
- use FPU at all or at least don't use common FPU (double or float) register
- variables.
- */
- sigmask(-1);
- #endif /* OSK */
- #ifdef NTSIG
- if (foo == SIGALRM)
- PostAlarmSigSem();
- else
- PostCtrlCSem();
- #else /* NTSIG */
- #ifdef NT
- cklongjmp(ckjaddr(sjbuf),1);
- #else /* NT */
- cklongjmp(sjbuf,1);
- #endif /* NT */
- #endif /* NTSIG */
- /* NOTREACHED */
- SIGRETURN;
- }
- static SIGTYP
- #ifdef CK_ANSIC
- dialint(int foo) /* Keyboard interrupt handler */
- #else
- dialint(foo) int foo;
- #endif /* CK_ANSIC */
- /* dialint */ {
- fail_code = F_INT;
- debug(F100,"dialint caught SIGINT","",0);
- #ifdef OS2
- signal(SIGINT, dialint);
- debug(F100,"dialint() SIGINT caught -- dialint restored","",0) ;
- #endif /* OS2 */
- #ifdef __EMX__
- signal(SIGINT, SIG_ACK); /* Needed for OS/2 */
- #endif /* __EMX__ */
- #ifdef OSK /* OS-9, see comment in dialtime() */
- sigmask(-1);
- #endif /* OSK */
- #ifdef NTSIG
- PostCtrlCSem() ;
- #ifdef CK_TAPI
- PostTAPIConnectSem();
- PostTAPIAnswerSem();
- #endif /* CK_TAPI */
- #else /* NTSIG */
- #ifdef NT
- cklongjmp(ckjaddr(sjbuf),1);
- #else /* NT */
- cklongjmp(sjbuf,1);
- #endif /* NT */
- #endif /* NT */
- SIGRETURN;
- }
- /*
- Routine to read a character from communication device, handling TELNET
- protocol negotiations in case we're connected to the modem through a
- TCP/IP TELNET modem server.
- */
- static int
- ddinc(n) int n; {
- #ifdef TNCODE
- int c = 0;
- int done = 0;
- debug(F101,"ddinc entry n","",n);
- while (!done) {
- c = ttinc(n);
- /* debug(F000,"ddinc","",c); */
- if (c < 0) return(c);
- #ifndef OS2
- if ((c == IAC) && network && IS_TELNET()) {
- switch (tn_doop((CHAR)(c & 0xff),duplex,ttinc)) {
- case 2: duplex = 0; continue;
- case 1: duplex = 1;
- default: continue;
- }
- } else done = 1;
- #else /* OS2 */
- done = !(c == IAC && network && IS_TELNET());
- scriptwrtbuf(c); /* TELNET negotiations handled by emulator */
- #endif /* OS2 */
- }
- return(c & 0xff);
- #else /* TNCODE */
- return(ttinc(n));
- #endif /* TNCODE */
- }
- static VOID
- ttslow(s,millisec) char *s; int millisec; { /* Output s-l-o-w-l-y */
- #ifdef TCPSOCKET
- extern int tn_nlm, tn_b_nlm;
- #endif /* TCPSOCKET */
- debug(F111,"ttslow",s,millisec);
- if (dialdpy && (duplex || !mdmecho)) { /* Echo the command in case modem */
- printf("%s\n",s); /* isn't echoing commands. */
- #ifdef OS2
- {
- char *s2 = s; /* Echo to emulator */
- while (*s2) {
- scriptwrtbuf((USHORT)*s2++);
- }
- scriptwrtbuf((USHORT)CR);
- scriptwrtbuf((USHORT)LF);
- }
- #endif /* OS2 */
- }
- for (; *s; s++) {
- ttoc(*s);
- #ifdef TCPSOCKET
- if (*s == CR && network && IS_TELNET()) {
- if (!TELOPT_ME(TELOPT_BINARY) && tn_nlm != TNL_CR)
- ttoc((char)((tn_nlm == TNL_CRLF) ? LF : NUL));
- else if (TELOPT_ME(TELOPT_BINARY) &&
- (tn_b_nlm == TNL_CRLF || tn_b_nlm == TNL_CRNUL))
- ttoc((char)((tn_b_nlm == TNL_CRLF) ? LF : NUL));
- }
- #endif /* TCPSOCKET */
- if (millisec > 0)
- msleep(millisec);
- }
- }
- /*
- * Wait for a string of characters.
- *
- * The characters are waited for individually, and other characters may
- * be received "in between". This merely guarantees that the characters
- * ARE received, and in the order specified.
- */
- static VOID
- waitfor(s) char *s; {
- CHAR c, x;
- while ((c = *s++)) { /* while more characters remain... */
- do { /* wait for the character */
- x = (CHAR) (ddinc(0) & 0177);
- debug(F000,"dial waitfor got","",x);
- if (dialdpy) {
- if (x != LF) conoc(x);
- if (x == CR) conoc(LF);
- }
- } while (x != c);
- }
- }
- static int
- didweget(s,r) char *s, *r; { /* Looks in string s for response r */
- int lr = (int)strlen(r); /* 0 means not found, 1 means found it */
- int i;
- debug(F110,"didweget",r,0);
- debug(F110," in",s,0);
- for (i = (int)strlen(s)-lr; i >= 0; i--)
- if ( s[i] == r[0] ) if ( !strncmp(s+i,r,lr) ) return( 1 );
- return( 0 );
- }
- /* R E S E T -- Reset alarms, etc. on exit. */
- static VOID
- dreset() {
- debug(F100,"dreset resetting alarm and signal handlers","",0);
- alarm(0);
- signal(SIGALRM,savalrm); /* restore alarm handler */
- signal(SIGINT,savint); /* restore interrupt handler */
- debug(F100,"dreset alarm and signal handlers reset","",0);
- }
- /*
- Call this routine when the modem reports that it has connected at a certain
- speed, giving that speed as the argument. If the connection speed is not
- the same as Kermit's current communication speed, AND the modem interface
- speed is not locked (i.e. DIAL SPEED-MATCHING is not ON), then change the
- device speed to the one given.
- */
- static VOID
- #ifdef CK_ANSIC
- spdchg(long s)
- #else
- spdchg(s) long s;
- #endif /* CK_ANSIC */
- /* spdchg */ {
- int s2;
- if (!mdmspd) /* If modem interface speed locked, */
- return; /* don't do this. */
- if (speed != s) { /* Speeds differ? */
- s2 = s / 10L; /* Convert to cps expressed as int */
- if (ttsspd(s2) < 0) { /* Change speed. */
- printf(" WARNING - speed change to %ld failed.\r\n",s);
- } else {
- printf(" Speed changed to %ld.\r\n",s);
- speed = s; /* Update global speed variable */
- }
- }
- }
- /*
- Display all characters received from modem dialer through this routine,
- for consistent handling of carriage returns and linefeeds.
- */
- static VOID
- #ifdef CK_ANSIC
- dialoc(char c)
- #else
- dialoc(c) char c;
- #endif /* CK_ANSIC */
- { /* dialoc */ /* Dial Output Character */
- if (dialdpy) {
- if (c != LF) conoc(c); /* Don't echo LF */
- if (c == CR) conoc(LF); /* Echo CR as CRLF */
- }
- }
- #ifndef NOSPL
- char *
- getdm(x) int x; { /* Return dial modifier */
- MDMINF * mp;
- int m;
- int ishayes = 0;
- m = mdmtyp;
- if (m < 1)
- if (mdmsav > -1)
- m = mdmsav;
- if (m < 1)
- return("");
- #ifndef MINIDIAL
- if (m == n_TAPI)
- m = n_HAYES;
- #endif /* MINIDIAL */
- mp = modemp[m];
- ishayes = (dialcapas ? dialcapas : mp->capas) & CKD_AT;
- switch (x) {
- case VN_DM_LP:
- return(ishayes ? "," : "");
- case VN_DM_SP:
- #ifdef MINIDIAL
- return("");
- #else
- return(m == n_USR ? "/" : "");
- #endif /* MINIDIAL */
- case VN_DM_PD:
- return(ishayes ? "P" : "");
- case VN_DM_TD:
- return(ishayes ? "T" : "");
- case VN_DM_WA:
- return(ishayes ? "@" : "");
- case VN_DM_WD:
- return(ishayes ? "W" : "");
- case VN_DM_RC:
- return(ishayes ? ";" : "");
- case VN_DM_HF:
- return(ishayes ? "!" : "");
- case VN_DM_WB:
- return(ishayes ? "$" : "");
- }
- return("");
- }
- #endif /* NOSPL */
- static VOID
- getdialmth() {
- if (dialmauto && diallcc) { /* If DIAL METHOD AUTO... */
- int i; /* and we know our area code... */
- for (i = 0; i < ndialtocc; i++) { /* First check Tone countries list */
- if (!strcmp(dialtocc[i],diallcc)) {
- dialmth = XYDM_T;
- break;
- }
- }
- for (i = 0; i < ndialpucc; i++) { /* Then Pulse countries list */
- if (!strcmp(dialpucc[i],diallcc)) {
- dialmth = XYDM_P;
- break;
- }
- }
- }
- }
- VOID /* Get dialing defaults from environment */
- getdialenv() {
- char *p = NULL;
- int i, x;
- makestr(&p,getenv("K_DIAL_DIRECTORY"));
- if (p) {
- int i;
- xwords(p,(MAXDDIR - 2),dialdir,0);
- for (i = 0; i < (MAXDDIR - 1); i++) {
- if (!dialdir[i+1])
- break;
- else
- dialdir[i] = dialdir[i+1];
- }
- ndialdir = i;
- }
- xmakestr(&diallcc,getenv("K_COUNTRYCODE")); /* My country code */
- xmakestr(&dialixp,getenv("K_LD_PREFIX")); /* My long-distance prefix */
- xmakestr(&dialldp,getenv("K_INTL_PREFIX")); /* My international prefix */
- xmakestr(&dialldp,getenv("K_TF_PREFIX")); /* Ny Toll-free prefix */
- #ifndef NOICP
- p = getenv("K_DIAL_METHOD"); /* Local dial method */
- if (p) if (*p) {
- extern struct keytab dial_m[];
- extern int ndial_m;
- i = lookup(dial_m,p,ndial_m,&x);
- if (i > -1) {
- if (i == XYDM_A) {
- dialmauto = 1;
- dialmth = XYDM_D;
- } else {
- dialmauto = 0;
- dialmth = i;
- }
- }
- }
- #endif /* NOICP */
- p = NULL;
- xmakestr(&p,getenv("K_TF_AREACODE")); /* Toll-free areacodes */
- if (p) {
- int i;
- xwords(p,7,dialtfc,0);
- for (i = 0; i < 8; i++) {
- if (!dialtfc[i+1])
- break;
- else
- dialtfc[i] = dialtfc[i+1];
- }
- ntollfree = i;
- free(p);
- }
- for (i = 0; i < MAXTPCC; i++) { /* Clear Tone/Pulse country lists */
- dialtocc[i] = NULL;
- dialpucc[i] = NULL;
- }
- for (i = 0; i < MAXTPCC; i++) { /* Init Tone country list */
- if (tonecc[i])
- makestr(&(dialtocc[i]),tonecc[i]);
- else
- break;
- }
- ndialtocc = i;
- for (i = 0; i < MAXTPCC; i++) { /* Init Pulse country list */
- if (pulsecc[i])
- makestr(&(dialpucc[i]),pulsecc[i]);
- else
- break;
- }
- ndialpucc = i;
- if (diallcc) { /* Have country code */
- if (!strcmp(diallcc,"1")) { /* If it's 1 */
- if (!dialldp) /* Set these prefixes... */
- makestr(&dialldp,"1");
- if (!dialtfp)
- makestr(&dialtfp,"1");
- if (!dialixp)
- makestr(&dialixp,"011");
- if (ntollfree == 0) { /* Toll-free area codes */
- if ((dialtfc[0] = malloc(4))) {
- ckstrncpy(dialtfc[0],"800",4); /* 1970-something */
- ntollfree++;
- if ((dialtfc[1] = malloc(4))) {
- ckstrncpy(dialtfc[1],"888",4); /* 1996 */
- ntollfree++;
- if ((dialtfc[2] = malloc(4))) {
- ckstrncpy(dialtfc[2],"877",4); /* 5 April 1998 */
- ntollfree++;
- if ((dialtfc[3] = malloc(4))) {
- ckstrncpy(dialtfc[3],"866",4); /* 2000? */
- ntollfree++;
- }
- }
- }
- }
- }
- } else if (!strcmp(diallcc,"358") &&
- ((int) strcmp(zzndate(),"19961011") > 0)
- ) { /* Finland */
- if (!dialldp) /* Long-distance prefix */
- makestr(&dialldp,"9");
- if (!dialixp) /* International dialing prefix */
- makestr(&dialixp,"990");
- } else { /* Not NANP or Finland */
- if (!dialldp)
- makestr(&dialldp,"0");
- if (!dialixp)
- makestr(&dialixp,"00");
- }
- }
- xmakestr(&diallac,getenv("K_AREACODE"));
- xmakestr(&dialpxo,getenv("K_PBX_OCP"));
- xmakestr(&dialpxi,getenv("K_PBX_ICP"));
- p = getenv("K_PBX_XCH");
- #ifdef COMMENT
- xmakestr(&dialpxx,p);
- #else
- if (p) if (*p) {
- char * s = NULL;
- char * pp[MAXPBXEXCH+2];
- makestr(&s,p); /* Make a copy for poking */
- if (s) {
- xwords(s,MAXPBXEXCH+1,pp,0); /* Note: pp[] is 1-based. */
- for (i = 0; i <= MAXPBXEXCH; i++) {
- if (!pp[i+1]) break;
- makestr(&(dialpxx[i]),pp[i+1]);
- ndialpxx++;
- }
- makestr(&s,NULL); /* Free poked copy */
- }
- }
- #endif /* COMMENT */
- }
- static int
- dialfail(x) int x; {
- char * s;
- fail_code = x;
- debug(F101,"ckudial dialfail","",x);
- dreset(); /* Reset alarm and signal handlers */
- printf("%s Failure: ", func_code == 0 ? "DIAL" : "ANSWER");
- if (dialdpy) { /* If showing progress */
- debug(F100,"dial display is on","",0);
- p = ck_time(); /* get current time; */
- if (*p) printf("%s: ",p);
- }
- switch (fail_code) { /* Type of failure */
- case F_TIME: /* Timeout */
- if (dial_what == DW_INIT)
- printf ("Timed out while trying to initialize modem.\n");
- else if (dial_what == DW_DIAL)
- printf ("%s interval expired.\n",
- func_code == 0 ? "DIAL TIMEOUT" : "ANSWER timeout");
- else
- printf("Timeout.\n");
- fflush(stdout);
- if (mdmcapas & CKD_AT)
- ttoc('\015'); /* Send CR to interrupt dialing */
- /* Some Hayes modems don't fail with BUSY on busy lines */
- dialsta = DIA_TIMO;
- debug(F110,"dial","timeout",0);
- break;
- case F_INT: /* Dialing interrupted */
- printf ("Interrupted.\n");
- fflush(stdout);
- #ifndef NOXFER
- interrupted = 1;
- #endif /* NOXFER */
- debug(F111,"dial","interrupted",mdmcapas & CKD_AT);
- if (mdmcapas & CKD_AT)
- ttoc('\015'); /* Send CR to interrupt dialing */
- dialsta = DIA_INTR;
- break;
- case F_MODEM: /* Modem detected a failure */
- debug(F110,"dialfail()","lbuf",0);
- if (lbuf && *lbuf) {
- printf(" \"");
- for (s = lbuf; *s; s++)
- if (isprint(*s))
- putchar(*s); /* Display printable reason */
- printf ("\"");
- } else printf(func_code == 0 ?
- " Call not completed." :
- " Call did not come in."
- );
- printf("\n");
- debug(F110,"dial",lbuf,0);
- if (dialsta < 0) dialsta = DIA_UNSP;
- break;
- case F_MINIT: /* Failure to initialize modem */
- printf ("Error initializing modem.\n");
- debug(F110,"dial","modem init",0);
- dialsta = DIA_NOIN;
- break;
- default:
- printf("unknown\n");
- debug(F110,"dial","unknown",0);
- fflush(stdout);
- if (mdmcapas & CKD_AT)
- ttoc('\015'); /* Send CR to interrupt dialing */
- dialsta = DIA_INTR;
- }
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- if (dialsta < 0) dialsta = DIA_UERR; /* Set failure code */
- return(0); /* Return zero (important) */
- }
- /* C K D I A L -- Dial up the remote system */
- /* Returns 1 if call completed, 0 otherwise */
- static int mdmwait, mdmstat = 0;
- #ifndef CK_TAPI
- static
- #endif /* CK_TAPI */
- int waitct;
- int mdmwaitd = 10 ; /* dialtmo / mdmwait difference */
- static char c;
- static char *telnbr;
- static int wr = 0; /* wr = wake rate */
- static char * ws; /* ws = wake string */
- static char * xnum = NULL;
- static int inited = 0;
- static SIGTYP
- #ifdef CK_ANSIC
- _dodial(void * threadinfo)
- #else /* CK_ANSIC */
- _dodial(threadinfo) VOID * threadinfo;
- #endif /* CK_ANSIC */
- /* _dodial */ {
- char c2;
- char *dcmd, *s, *flocmd = NULL;
- int x = 0, n = F_TIME;
- #ifdef NTSIG
- signal( SIGINT, dialint );
- if (threadinfo) { /* Thread local storage... */
- TlsSetValue(TlsIndex,threadinfo);
- }
- #endif /* NTSIG */
- dcmd = dialcmd ? dialcmd : mp->dial_str;
- if ((int)strlen(dcmd) + (int)strlen(telnbr) > (LBUFL - 2)) {
- printf("DIAL command + phone number too long!\n");
- dreset();
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN; /* No conversation with modem to complete dialing */
- }
- makestr(&xnum,telnbr);
- getdialmth(); /* Get dial method */
- #ifdef CK_ATDT
- /* Combine the SET DIAL METHOD command with the DIAL command string */
- if (!dialcmd && /* Using default DIAL command */
- (mdmcapas & CKD_AT) && /* AT command set only */
- ((dialmth == XYDM_T && !dialtone) || /* and using default */
- (dialmth == XYDM_P && !dialpulse))) { /* modem commands... */
- char c;
- debug(F110,"dial atdt xnum 1",xnum,0);
- s = dcmd;
- debug(F110,"dial atdt s",s,0);
- if (*telnbr != 'T' &&
- *telnbr != 'P' &&
- *telnbr != 't' &&
- *telnbr != 'p' &&
- !ckstrcmp(s,"atd",3,0) &&
- s[3] != 'T' &&
- s[3] != 'P' &&
- s[3] != 't' &&
- s[3] != 'p') {
- char xbuf[200];
- c = (dialmth == XYDM_T) ? 'T' : 'P';
- if (islower(s[0]))
- c = tolower(c);
- if ((int)strlen(telnbr) < 199) {
- sprintf(xbuf,"%c%s",c,telnbr);
- makestr(&xnum,xbuf);
- }
- }
- }
- #endif /* CK_ATDT */
- debug(F111,"_dodial",xnum,xredial);
- /* Hang up the modem (in case it wasn't "on hook") */
- /* But only if SET DIAL HANGUP ON... */
- if (!xredial) { /* Modem not initalized yet. */
- inited = 0;
- }
- if (!xredial || !inited) {
- if (dialhup() < 0) { /* Hangup first */
- debug(F100,"_dodial dialhup failed","",0);
- #ifndef MINIDIAL
- if (mdmcapas & CKD_TB) /* Telebits might need a BREAK */
- ttsndb(); /* first. */
- #endif /* MINIDIAL */
- if (dialhng && dialsta != DIA_PART) { /* If hangup failed, */
- ttclos(0); /* close and reopen the device. */
- if (ttopen(ttname,&local,mymdmtyp,0) < 0) {
- printf("Sorry, Can't hang up communication device.\n");
- printf("Try 'set line %s' again.\n",ttname);
- dialsta = DIA_HANG;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- dreset();
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- }
- }
- }
- inited = 0; /* We hung up so must reinit */
- }
- #ifndef MINIDIAL
- /* Don't start talking to Rolm too soon */
- if (mymdmtyp == n_ROLM && dialsta != DIA_PART)
- msleep(500);
- #endif /* MINIDIAL */
- if (dialsta != DIA_PART /* Some initial setups. */
- #ifndef MINIDIAL
- && mymdmtyp != n_ATTUPC
- #endif /* MINIDIAL */
- ) {
- fail_code = F_MINIT; /* Default failure code */
- dial_what = DW_INIT; /* What I'm Doing Now */
- if (dialdpy) { /* If showing progress, */
- p = ck_time(); /* get timestamp. */
- if (!inited)
- if (*p)
- printf(" Initializing: %s...\n",p);
- }
- }
- #ifndef MINIDIAL
- #ifdef ATT7300
- if (mymdmtyp == n_ATTUPC) {
- /*
- For ATT7300/Unix PC's with their special internal modem. Whole dialing
- process is handled right here, an exception to the normal structure.
- Timeout and user interrupts are enabled during dialing. attdial() is in
- file ckutio.c. - jrd
- */
- _PROTOTYP( int attdial, (char *, long, char *) );
- fail_code = F_MODEM; /* Default failure code */
- dial_what = DW_DIAL;
- if (dialdpy) { /* If showing progress */
- p = ck_time(); /* get current time; */
- if (*p)
- printf(" Dialing: %s...\n",p);
- }
- alarm(waitct); /* Set alarm */
- if (attdial(ttname,speed,telnbr)) { /* dial internal modem */
- dreset(); /* reset alarms, etc. */
- printf(" Call failed.\r\n");
- dialhup(); /* Hangup the call */
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- dialsta = DIA_UERR;
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN; /* return failure */
- }
- dreset(); /* reset alarms, etc. */
- ttpkt(speed,FLO_DIAX,parity); /* cancel dialing ioctl */
- if (!quiet && !backgrd) {
- if (dialdpy) {
- printf("\n");
- printf(" Call complete.\r\n");
- } else if (modemmsg[0])
- printf(" Call complete: \"%s\".\r\n",(char *)modemmsg);
- else
- printf(" Call complete.\r\n");
- }
- #ifdef CKLOGDIAL
- dologdial(telnbr);
- #endif /* CKLOGDIAL */
- dialsta = DIA_OK;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN; /* No conversation with modem to complete dialing */
- } else
- #endif /* ATT7300 */
- #ifdef CK_TAPI
- if (tttapi && !tapipass) { /* TAPI Dialing */
- switch (func_code) {
- case 0: /* Dial */
- if (cktapidial(telnbr)) {
- fail_code = 0;
- if (partial) {
- dialsta = DIA_PART;
- } else {
- dialsta = DIA_OK;
- speed = ttgspd();
- }
- } else {
- if (dialsta == DIA_PART)
- cktapihangup();
- if (!fail_code)
- fail_code = F_MODEM;
- dialsta = DIA_TAPI;
- }
- break;
- case 1: { /* Answer */
- long strttime = time((long *)NULL);
- long diff = 0;
- do {
- if (dialatmo > 0) {
- strttime += diff;
- waitct -= diff;
- }
- fail_code = 0;
- if (cktapianswer()) { /* SUCCESS */
- dialsta = DIA_OK;
- speed = ttgspd();
- break;
- } else { /* FAILURE */
- if (fail_code) {
- dialsta = DIA_TAPI;
- break;
- } else {
- fail_code = F_MODEM;
- dialsta = DIA_TAPI;
- }
- }
- if (dialatmo > 0) {
- diff = time((long *)NULL) - strttime;
- }
- } while ((dialatmo > 0) ? (diff < waitct) : 1);
- break;
- }
- }
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- } else
- #endif /* CK_TAPI */
- #endif /* MINIDIAL */
- /* Modems with AT command set... */
- if ((mdmcapas & CKD_AT) && dialsta != DIA_PART) {
- if (dialpace > -1) /* Set intercharacter pacing */
- wr = dialpace;
- else
- wr = mp->wake_rate;
- if (dialini) /* Get wakeup/init string */
- ws = dialini;
- else
- ws = mp->wake_str;
- #ifdef COMMENT
- if (!ws) ws = "\015"; /* If none, use CR */
- #endif /* COMMENT */
- /* First get the modem's attention and enable result codes */
- for (tries = 0; tries < 5; tries++) { /* Send short command */
- if (tries > 0) {
- ttoc('\015'); /* AT must go first for speed */
- msleep(wr); /* detection. */
- }
- if (mymdmtyp == n_GENERIC) /* Force word result codes */
- ttslow("ATQ0V1\015",wr); /* for generic modem type */
- else
- ttslow("ATQ0\015",wr);
- mdmstat = getok(tries < 2 ? 2 : tries, 1); /* Get response */
- if (mdmstat > 0) break; /* OK - done */
- if (dialdpy && tries > 0) {
- printf("\r\n No response from modem");
- if (tries == 4) {
- printf(".\r\n");
- dialsta = DIA_NRSP;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN; /* return failure */
- }
- printf(", retrying%s...\r\n",
- (tries > 1) ? " again" : "");
- fflush(stdout);
- }
- ttflui();
- switch (tries) {
- case 0: msleep(100); break;
- case 1: ttsndb(); break;
- default:
- if (network) {
- ttsndb();
- } else {
- if (tries == 2) {
- tthang();
- ttflui();
- } else {
- mdmhup();
- }
- inited = 0;
- }
- }
- fflush(stdout);
- }
- debug(F101,"_dodial ATQ0 mdmstat","",mdmstat);
- if (xredial && inited) { /* Redialing... */
- ttoc('\015'); /* Cancel previous */
- msleep(250); /* Wait a bit */
- #ifdef COMMENT
- /* This wasn't the problem... */
- ttflui(); /* Clear out stuff from modem setup */
- ttslow("ATS7=60\015",wr); /* Redo carrier wait */
- getok(4,1); /* Get response */
- #endif /* COMMENT */
- alarm(0); /* Just in case... */
- ttflui(); /* Clear out stuff from modem setup */
- goto REDIAL; /* Skip setup - we already did it */
- }
- /*
- Do flow control next because a long init string echoing back could
- cause data overruns, causing us to miss the OK, or (worse) to get out
- of sync entirely.
- */
- x = 0; /* User said SET DIAL FLOW RTS/CTS */
- if (dialfc == FLO_RTSC || /* Even if Kermit's FLOW isn't... */
- (dialfc == FLO_AUTO && flow == FLO_RTSC)) {
- if (dialhwfc) { /* User-defined HWFC string */
- if (*dialhwfc) {
- x = 1;
- flocmd = dialhwfc;
- }
- } else if ((mdmcapas & CKD_HW) && *(mp->hwfc_str)) {
- x = 1;
- flocmd = mp->hwfc_str;
- }
- } else if (dialfc == FLO_XONX || /* User said SET DIAL FLOW SOFT */
- (dialfc == FLO_AUTO && flow == FLO_XONX)) {
- if (dialswfc) {
- if (*dialswfc) {
- x = 1;
- flocmd = dialswfc;
- }
- } else if ((mdmcapas & CKD_SW) && *(mp->swfc_str)) {
- x = 1;
- flocmd = mp->swfc_str;
- }
- } else if (dialfc == FLO_NONE) { /* User said SET DIAL FLOW NONE */
- if (dialnofc) {
- if (*dialnofc) {
- x = 1;
- flocmd = dialnofc;
- }
- } else if (mp->nofc_str && *(mp->nofc_str)) {
- x = 1;
- flocmd = mp->nofc_str;
- }
- }
- if (x) { /* Send the flow control command */
- debug(F110,"_dodial flocmd",flocmd,0);
- for (tries = 4; tries > 0; tries--) { /* Send the command */
- ttslow(flocmd,wr);
- mdmstat = getok(5,1);
- if (mdmstat > 0) break;
- if (dialdpy && tries > 1)
- printf(" No response from modem, retrying%s...\n",
- (tries < 4) ? " again" : "");
- }
- #ifdef CK_TTSETFLOW
- #ifdef CK_RTSCTS
- /*
- So far only ckutio.c has ttsetflow().
- We have just told the modem to turn on RTS/CTS flow control and the modem
- has said OK. But we ourselves have not turned it on yet because of the
- disgusting ttpkt(...FLO_DIAL...) hack. So now, if the computer does not
- happen to be asserting RTS, the modem will no longer send characters to it.
- So at EXACTLY THIS POINT, we must enable RTS/CTS in the device driver.
- */
- if (dialfc == FLO_RTSC ||
- (dialfc == FLO_AUTO && flow == FLO_RTSC)) {
- ttsetflow(FLO_RTSC);
- }
- #endif /* CK_RTSCTS */
- #endif /* CK_TTSETFLOW */
- }
- ttflui(); /* Clear out stuff from modem setup */
- msleep(250);
- if (!ws) goto xdialec; /* No init string */
- if (!*ws) goto xdialec;
- for (tries = 4; tries > 0; tries--) { /* Send init string */
- ttslow(ws,wr);
- mdmstat = getok(4,1); /* Get response */
- if (mdmstat > 0) break;
- if (dialdpy && tries > 1)
- printf(" No response from modem, retrying%s...\n",
- (tries < 4) ? " again" : "");
- }
- debug(F101,"_dodial wake_str mdmstat","",mdmstat);
- if (mdmstat < 1) { /* Initialized OK? */
- dialfail(F_MINIT); /* No, fail. */
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- }
- #ifndef MINIDIAL
- } else if (mymdmtyp == n_ATTDTDM && dialsta != DIA_PART) { /* AT&T ... */
- ttsndb(); /* Send BREAK */
- #endif /* MINIDIAL */
- } else if (dialsta != DIA_PART) { /* All others */
- /* Place modem into command mode */
- ws = dialini ? dialini : mp->wake_str;
- if (ws && (int)strlen(ws) > 0) {
- debug(F111,"_dodial default, wake string", ws, wr);
- ttslow(ws, wr);
- } else debug(F100,"_dodial no wake_str","",0);
- if (mp->wake_prompt && (int)strlen(mp->wake_prompt) > 0) {
- debug(F110,"_dodial default, waiting for wake_prompt",
- mp->wake_prompt,0);
- alarm(10);
- waitfor(mp->wake_prompt);
- alarm(0);
- } else debug(F100,"_dodial no wake_prompt","",0);
- }
- /* Handle error correction, data compression, and flow control... */
- xdialec:
- if (dialsta != DIA_PART) {
- alarm(0); /* Turn off alarm */
- debug(F100,"_dodial got wake prompt","",0);
- msleep(500); /* Allow settling time */
- /* Enable/disable error-correction */
- x = 0;
- if (dialec) { /* DIAL ERROR-CORRECTION is ON */
- if (dialecon) { /* SET DIAL STRING ERROR-CORRECTION */
- if (*dialecon) {
- x = 1;
- ttslow(dialecon, wr);
- }
- } else if ((mdmcapas & CKD_EC) && *(mp->ec_on_str)) {
- x = 1;
- ttslow(mp->ec_on_str, wr);
- }
- #ifdef COMMENT
- else printf(
- "WARNING - I don't know how to turn on EC for this modem\n"
- );
- #endif /* COMMENT */
- } else {
- if (dialecoff) { /* DIAL ERROR-CORRECTION OFF */
- if (*dialecoff) {
- x = 1;
- ttslow(dialecoff, wr);
- }
- } else if ((mdmcapas & CKD_EC) && *(mp->ec_off_str)) {
- x = 1;
- ttslow(mp->ec_off_str, wr);
- }
- #ifdef COMMENT
- else printf(
- "WARNING - I don't know how to turn off EC for this modem\n"
- );
- #endif /* COMMENT */
- }
- /* debug(F101,"ckudia xx_ok","",xx_ok); */
- if (x && xx_ok) { /* Look for OK response */
- debug(F100,"ckudia calling xx_ok for EC","",0);
- x = (*xx_ok)(5,1);
- debug(F101,"ckudia xx_ok","",x);
- if (x < 0) {
- printf("WARNING - Trouble enabling error-correction.\n");
- printf(
- " Likely cause: Your modem is an RPI model, which does not have built-in\n");
- printf(" error correction and data compression.");
- }
- }
- /* Enable/disable data compression */
- if (x > 0) x = 0;
- if (dialdc) {
- if (x < 0 || !dialec) {
- printf(
- "WARNING - You can't have compression without error correction.\n");
- } else if (dialdcon) { /* SET DIAL STRING ... */
- if (*dialdcon) {
- x = 1;
- ttslow(dialdcon, wr);
- }
- } else if ((mdmcapas & CKD_DC) && *(mp->dc_on_str)) {
- x = 1;
- ttslow(mp->dc_on_str, wr);
- }
- #ifdef COMMENT
- else printf(
- "WARNING - I don't know how to turn on DC for this modem\n"
- );
- #endif /* COMMENT */
- } else {
- if (dialdcoff) {
- if (*dialdcoff) {
- x = 1;
- ttslow(dialdcoff, wr);
- }
- } else if ((mdmcapas & CKD_DC) && *(mp->dc_off_str)) {
- x = 1;
- ttslow(mp->dc_off_str, wr);
- }
- #ifdef COMMENT
- else printf(
- "WARNING - I don't know how to turn off compression for this modem\n"
- );
- #endif /* COMMENT */
- }
- if (x && xx_ok) { /* Look for OK response */
- x = (*xx_ok)(5,1);
- if (x < 0) printf("WARNING - Trouble enabling compression\n");
- }
- }
- #ifndef NOXFER
- #ifndef MINIDIAL
- if (mdmcapas & CKD_KS && dialsta != DIA_PART) { /* Kermit spoof */
- int r; /* Register */
- char tbcmdbuf[64]; /* Command buffer */
- switch (mymdmtyp) {
- case n_MICROCOM: /* Microcoms in SX mode */
- if (dialksp)
- sprintf(tbcmdbuf,"APM1;KMC%d\015",stchr); /* safe */
- else
- sprintf(tbcmdbuf,"APM0\015"); /* safe */
- ttslow(tbcmdbuf, MICROCOM.wake_rate);
- alarm(3);
- waitfor(mp->wake_prompt);
- alarm(0);
- break;
- case n_TELEBIT: /* Old and new Telebits */
- case n_TBNEW:
- if (!dialksp) {
- sprintf(tbcmdbuf,"ATS111=0\015"); /* safe */
- } else {
- switch (parity) { /* S111 value depends on parity */
- case 'e': r = 12; break;
- case 'm': r = 13; break;
- case 'o': r = 11; break;
- case 's': r = 14; break;
- case 0:
- default: r = 10; break;
- }
- sprintf(tbcmdbuf,"ATS111=%d S112=%d\015",r,stchr); /* safe */
- }
- ttslow(tbcmdbuf, wr);
- /* Not all Telebit models have the Kermit spoof, so ignore response. */
- if (xx_ok) { /* Get modem's response */
- x = (*xx_ok)(5,1);
- }
- }
- }
- #endif /* MINIDIAL */
- #endif /* NOXFER */
- /* Speaker */
- if (mymdmtyp != n_GENERIC &&
- (mdmcapas & CKD_AT) && (dialsta != DIA_PART) &&
- !dialspon && !dialspoff &&
- !dialvol1 && !dialvol2 &&!dialvol3) {
- /* AT command set and commands have not been customized */
- /* so combine speaker and volume commands. */
- if (mdmspk)
- sprintf(lbuf,"ATM1L%d%c",mdmvol,13); /* safe */
- else
- sprintf(lbuf,"ATM0%c",13); /* safe */
- ttslow(lbuf,wr); /* Send command */
- getok(5,1); /* Get but ignore response */
- } else if (dialsta != DIA_PART) { /* Customized or not AT commands */
- x = 0; /* Do it the hard way */
- if (mdmspk) {
- if (dialspon) {
- if (*dialspon) {
- x = 1;
- ttslow(dialspon,wr);
- }
- } else {
- if (mp->sp_on_str[0]) {
- x = 1;
- ttslow(mp->sp_on_str,wr);
- }
- }
- } else {
- /* s = dialspoff ? dialspoff : mp->sp_off_str; */
- if (dialspoff) {
- if (*dialspoff) {
- x = 1;
- ttslow(dialspoff,wr);
- }
- } else {
- if (mp->sp_off_str[0]) {
- x = 1;
- ttslow(mp->sp_off_str,wr);
- }
- }
- }
- if (x) {
- if (xx_ok) /* Get response */
- x = (*xx_ok)(5,1);
- if (x && mdmspk) { /* Good response and speaker on? */
- switch (mdmvol) { /* Yes, send volume command. */
- case 0:
- case 1:
- s = dialvol1 ? dialvol1 : mp->vol1_str; break;
- case 2:
- s = dialvol2 ? dialvol2 : mp->vol2_str; break;
- case 3:
- s = dialvol3 ? dialvol3 : mp->vol3_str; break;
- default:
- s = NULL;
- }
- if (s) if (*s) { /* Send volume command. */
- ttslow(s, wr);
- if (xx_ok) /* Get response but ignore it */
- (*xx_ok)(5,1);
- }
- }
- }
- }
- #ifndef CK_ATDT
- /* Dialing Method */
- if (dialmth && dialsta != DIA_PART) { /* If dialing method specified... */
- char *s = ""; /* Do it here... */
- if (dialmth == XYDM_T && dialtone) /* Tone */
- s = dialtone;
- else if (dialmth == XYDM_P && dialpulse) /* Pulse */
- s = dialpulse;
- if (s) if (*s) {
- ttslow(s, wr);
- if (xx_ok) /* Get modem's response */
- (*xx_ok)(5,1); /* (but ignore it...) */
- }
- }
- #endif /* CK_ATDT */
- if (dialidt) { /* Ignore dialtone? */
- char *s = "";
- s = dialx3 ? dialx3 : mp->ignoredt;
- if (s) if (*s) {
- ttslow(s, wr);
- if (xx_ok) /* Get modem's response */
- (*xx_ok)(5,1); /* (but ignore it...) */
- }
- }
- {
- char *s = ""; /* Last-minute init string? */
- s = dialini2 ? dialini2 : mp->ini2;
- if (s) if (*s) {
- ttslow(s, wr);
- if (xx_ok) /* Get modem's response */
- (*xx_ok)(5,1); /* (but ignore it...) */
- }
- }
- if (func_code == 1) { /* ANSWER (not DIAL) */
- char *s;
- s = dialaaon ? dialaaon : mp->aa_on_str;
- if (!s) s = "";
- if (*s) {
- /* Here we would handle caller ID */
- ttslow(s, (dialpace > -1) ? wr : mp->dial_rate);
- if (xx_ok) /* Get modem's response */
- (*xx_ok)(5,1); /* (but ignore it...) */
- } else {
- printf(
- "WARNING - I don't know how to enable autoanswer for this modem.\n"
- );
- } /* And skip all the phone-number & dialing stuff... */
- alarm(waitct); /* This much time allowed. */
- debug(F101,"_dodial ANSWER waitct","",waitct);
- } else { /* DIAL (not ANSWER) */
- if (dialsta != DIA_PART) { /* Last dial was not partial */
- char *s = "";
- #ifdef COMMENT
- s = dialaaoff ? dialaaoff : mp->aa_off_str;
- #endif /* COMMENT */
- if (s) if (*s) {
- ttslow(s, (dialpace > -1) ? wr : mp->dial_rate);
- if (xx_ok) /* Get modem's response */
- (*xx_ok)(5,1); /* (but ignore it...) */
- }
- /* Put modem into dialing mode, if the modem requires it. */
- if (mp->dmode_str && *(mp->dmode_str)) {
- ttslow(mp->dmode_str, (dialpace > -1) ? wr : mp->dial_rate);
- savalrm = signal(SIGALRM,dialtime);
- alarm(10);
- /* Wait for prompt, if any expected */
- if (mp->dmode_prompt && *(mp->dmode_prompt)) {
- waitfor(mp->dmode_prompt);
- msleep(300);
- }
- alarm(0); /* Turn off alarm on dialing prompts */
- signal(SIGALRM,savalrm); /* Restore alarm */
- }
- }
- /* AT-Command-Set non-Generic modem */
- if (mdmcapas & CKD_AT && mymdmtyp != n_GENERIC &&
- dialsta != DIA_PART) {
- if (mdmwait > 255) /* If larger than maximum, */
- mdmwait = 255; /* make it maximum. */
- if (dialesc > 0 && /* Modem escape character is set */
- dialmhu > 0) { /* Hangup method is modem command */
- int x = dialesc;
- if (dialesc < 0 || dialesc > 127)
- x = 128;
- sprintf(lbuf,
- "ATS2=%dS7=%d\015",
- dialesc ? x : mp->esc_char, mdmwait); /* safe */
- } else
- sprintf(lbuf,"ATS7=%d%c",mdmwait,13); /* safe */
- ttslow(lbuf,wr); /* Set it. */
- mdmstat = getok(5,1); /* Get response from modem */
- /* If it gets an error, go ahead anyway */
- debug(F101,"_dodial S7 mdmstat","",mdmstat);
- }
- ttflui(); /* Clear out stuff from modem setup */
- inited = 1; /* Remember modem is initialized */
- REDIAL:
- if ((int)strlen(dcmd) + (int)strlen(xnum) > LBUFL)
- ckstrncpy(lbuf,"NUMBER TOO LONG!",LBUFL);
- else
- sprintf(lbuf, dcmd, xnum); /* safe (prechecked) */
- debug(F110,"dialing",lbuf,0);
- /* Send the dialing string */
- ttslow(lbuf,dialpace > -1 ? wr : mp->dial_rate);
- fail_code = F_MODEM; /* New default failure code changes */
- dial_what = DW_DIAL; /* and our state, too. */
- if (dialdpy) { /* If showing progress */
- p = ck_time(); /* get current time; */
- if (*p) printf(" Dialing: %s...\n",p);
- #ifdef VMS
- printf(" \n");
- fflush(stdout);
- #endif /* VMS */
- }
- alarm(waitct); /* This much time allowed. */
- debug(F101,"_dodial waitct","",waitct);
- #ifndef MINIDIAL
- #ifdef OLDMODEMS
- switch (mymdmtyp) {
- case n_RACAL: /* Acknowledge dialing string */
- sleep(3);
- ttflui();
- ttoc('\015');
- break;
- case n_VENTEL:
- waitfor("\012\012"); /* Ignore the first two strings */
- break;
- default:
- break;
- }
- #endif /* OLDMODEMS */
- #endif /* MINIDIAL */
- }
- /* Check for connection */
- mdmstat = 0; /* No status yet */
- lbuf[0] = NUL; /* Default reason for failure */
- debug(F101,"dial awaiting response, mymdmtyp","",mymdmtyp);
- #ifndef NOSPL
- modemmsg[0] = NUL;
- #endif /* NOSPL */
- while (mdmstat == 0) { /* Till we get a result or time out */
- if ((mdmcapas & CKD_AT) && nonverbal) { /* AT command set */
- gethrn(); /* In digit result mode */
- if (partial && dialsta == DIA_ERR) {
- /*
- If we get an error here, the phone is still
- off hook so we have to hang it up.
- */
- dialhup();
- dialsta = DIA_ERR; /* (because dialhup() changes it) */
- }
- continue;
- } else if (mymdmtyp == n_UNKNOWN) { /* Unknown modem type */
- int x, y = waitct;
- mdmstat = D_FAILED; /* Assume failure. */
- while (y-- > -1) {
- x = ttchk();
- if (x > 0) {
- if (x > LBUFL) x = LBUFL;
- x = ttxin(x,(CHAR *)lbuf);
- if ((x > 0) && dialdpy) conol(lbuf);
- } else if (network
- #ifdef TN_COMPORT
- && !istncomport()
- #endif /* TN_COMPORT */
- && x < 0) { /* Connection dropped */
- inited = 0;
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- dialsta = DIA_IO; /* Call it an I/O error */
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- SIGRETURN;
- }
- x = ttgmdm(); /* Try to read modem signals */
- if (x < 0) break; /* Can't, fail. */
- if (x & BM_DCD) { /* Got signals OK. Carrier present? */
- mdmstat = CONNECTED; /* Yes, done. */
- break;
- } /* No, keep waiting. */
- sleep(1);
- }
- continue;
- }
- for (n = -1; n < LBUFL-1; ) { /* Accumulate modem response */
- int xx;
- c2 = (char) (xx = ddinc(0)); /* Read a character, blocking */
- if (xx < 1) /* Ignore NULs and errors */
- continue; /* (Timeout will handle errors) */
- else /* Real character, keep it */
- lbuf[++n] = (char) (c2 & 0177);
- dialoc(lbuf[n]); /* Maybe echo it */
- if (mdmcapas & CKD_V25) { /* V.25bis dialing... */
- /*
- This assumes that V.25bis indications are all at least 3 characters long
- and are terminated by either CRLF or LFCR.
- */
- if (mymdmtyp == n_CCITT) {
- if (n < 3) continue;
- if ((lbuf[n] == CR) && (lbuf[n-1] == LF)) break;
- if ((lbuf[n] == LF) && (lbuf[n-1] == CR)) break;
- }
- #ifndef MINIDIAL
- else if (mymdmtyp == n_DIGITEL) {
- if (((lbuf[n] == CR) && (lbuf[n-1] == LF)) ||
- ((lbuf[n] == LF) && (lbuf[n-1] == CR)))
- break;
- else
- continue;
- }
- #endif /* MINIDIAL */
- } else { /* All others, break on CR or LF */
- if ( lbuf[n] == CR || lbuf[n] == LF ) break;
- }
- }
- lbuf[++n] = '\0'; /* Terminate response from modem */
- debug(F111,"_dodial modem response",lbuf,n);
- #ifndef NOSPL
- ckstrncpy(modemmsg,lbuf,LBUFL); /* Call result message */
- lbuf[79] = NUL;
- {
- int x; /* Strip junk from end */
- x = (int)strlen(modemmsg) - 1;
- while (x > -1) {
- if (modemmsg[x] < (char) 33)
- modemmsg[x] = NUL;
- else
- break;
- x--;
- }
- }
- #endif /* NOSPL */
- if (mdmcapas & CKD_AT) { /* Hayes AT command set */
- gethrw(); /* in word result mode */
- if (partial && dialsta == DIA_ERR) {
- dialhup();
- dialsta = DIA_ERR; /* (because dialhup() changes it) */
- }
- continue;
- } else if (mdmcapas & CKD_V25) { /* CCITT command set */
- if (didweget(lbuf,"VAL")) { /* Dial command confirmation */
- #ifndef MINIDIAL
- if (mymdmtyp == n_CCITT)
- #endif /* MINIDIAL */
- continue; /* Go back and read more */
- #ifndef MINIDIAL
- /* Digitel doesn't give an explicit connect confirmation message */
- else {
- int n;
- for (n = -1; n < LBUFL-1; ) {
- lbuf[++n] = c2 = (char) (ddinc(0) & 0177);
- dialoc(lbuf[n]);
- if (((lbuf[n] == CR) && (lbuf[n-1] == LF)) ||
- ((lbuf[n] == LF) && (lbuf[n-1] == CR)))
- break;
- }
- mdmstat = CONNECTED; /* Assume we're connected */
- if (dialdpy && carrier != CAR_OFF) {
- #ifdef TN_COMPORT
- if (istncomport()) {
- int i;
- for (i = 0; i < 5; i++) {
- debug(F100,"TN Com Port DCD wait...","",0);
- if ((n = ttgmdm()) >= 0) {
- if ((n & BM_DCD))
- break;
- msleep(500);
- tnc_wait(
- (CHAR *)"_dodial waiting for DCD",1);
- }
- }
- } else
- #endif /* TN_COMPORT */
- sleep(1); /* Wait a second */
- n = ttgmdm(); /* Try to read modem signals */
- if ((n > -1) && ((n & BM_DCD) == 0))
- printf("WARNING - no carrier\n");
- }
- }
- #endif /* MINIDIAL */
- /* Standard V.25bis stuff */
- } else if (didweget(lbuf,"CNX")) { /* Connected */
- mdmstat = CONNECTED;
- } else if (didweget(lbuf, "INV")) {
- mdmstat = D_FAILED; /* Command error */
- dialsta = DIA_ERR;
- ckstrncpy(lbuf,"INV",LBUFL);
- } else if (didweget(lbuf,"CFI")) { /* Call Failure */
- if (didweget(lbuf,"AB")) { /* Interpret reason code */
- ckstrncpy(lbuf,"AB: Timed out",LBUFL);
- dialsta = DIA_TIMO;
- } else if (didweget(lbuf,"CB")) {
- ckstrncpy(lbuf,"CB: Local DCE Busy",LBUFL);
- dialsta = DIA_NRDY;
- } else if (didweget(lbuf,"ET")) {
- ckstrncpy(lbuf,"ET: Busy",LBUFL);
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf, "NS")) {
- ckstrncpy(lbuf,"NS: Number not stored",LBUFL);
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"NT")) {
- ckstrncpy(lbuf,"NT: No answer",LBUFL);
- dialsta = DIA_NOAN;
- } else if (didweget(lbuf,"RT")) {
- ckstrncpy(lbuf,"RT: Ring tone",LBUFL);
- dialsta = DIA_RING;
- } else if (didweget(lbuf,"PV")) {
- ckstrncpy(lbuf,"PV: Parameter value error",LBUFL);
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"PS")) {
- ckstrncpy(lbuf,"PS: Parameter syntax error",LBUFL);
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"MS")) {
- ckstrncpy(lbuf,"MS: Message syntax error",LBUFL);
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"CU")) {
- ckstrncpy(lbuf,"CU: Command unknown",LBUFL);
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"FC")) {
- ckstrncpy(lbuf,"FC: Forbidden call",LBUFL);
- dialsta = DIA_NOAC;
- }
- mdmstat = D_FAILED;
- } else if (didweget(lbuf,"INC")) { /* Incoming Call */
- ckstrncpy(lbuf,"INC: Incoming call",LBUFL);
- dialsta = DIA_RING;
- mdmstat = D_FAILED;
- } else if (didweget(lbuf,"DLC")) { /* Delayed Call */
- ckstrncpy(lbuf,"DLC: Delayed call",LBUFL);
- dialsta = DIA_NOAN;
- mdmstat = D_FAILED;
- } else /* Response was probably an echo. */
- #ifndef MINIDIAL
- if (mymdmtyp == n_CCITT)
- #endif /* MINIDIAL */
- continue;
- #ifndef MINIDIAL
- else /* Digitel: If no error, connect. */
- mdmstat = CONNECTED;
- #endif /* MINIDIAL */
- break;
- } else if (n) { /* Non-Hayes-compatibles... */
- switch (mymdmtyp) {
- #ifndef MINIDIAL
- case n_ATTMODEM:
- /* Careful - "Connected" / "Not Connected" */
- if (didweget(lbuf,"Busy")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"Not connected") ||
- didweget(lbuf,"Not Connected")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (didweget(lbuf,"No dial tone") ||
- didweget(lbuf,"No Dial Tone")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"No answer") ||
- didweget(lbuf,"No Answer")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- } else if (didweget(lbuf,"Answered") ||
- didweget(lbuf,"Connected")) {
- mdmstat = CONNECTED;
- dialsta = DIA_OK;
- }
- break;
- case n_ATTISN:
- if (didweget(lbuf,"ANSWERED")) {
- mdmstat = CONNECTED;
- dialsta = DIA_OK;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"DISCONNECT")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DISC;
- } else if (didweget(lbuf,"NO ANSWER")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- } else if (didweget(lbuf,"WRONG ADDRESS")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAC;
- }
- break;
- case n_ATTDTDM:
- if (didweget(lbuf,"ANSWERED")) {
- mdmstat = CONNECTED;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"CHECK OPTIONS")) {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"DISCONNECTED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DISC;
- } else if (didweget(lbuf,"DENIED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAC;
- }
- #ifdef DEBUG
- #ifdef ATT6300
- /* Horrible hack lost in history. */
- else if (deblog && didweget(lbuf,"~~"))
- mdmstat = CONNECTED;
- #endif /* ATT6300 */
- #endif /* DEBUG */
- break;
- #ifdef OLDMODEMS
- case n_CERMETEK:
- if (didweget(lbuf,"\016A")) {
- mdmstat = CONNECTED;
- ttslow("\016U 1\015",200); /* Make transparent*/
- }
- break;
- case n_DF03:
- /* Because response lacks CR or NL . . . */
- c = (char) (ddinc(0) & 0177);
- dialoc(c);
- debug(F000,"dial df03 got","",c);
- if ( c == 'A' ) mdmstat = CONNECTED;
- if ( c == 'B' ) mdmstat = D_FAILED;
- break;
- case n_DF100: /* DF100 has short response codes */
- if (strcmp(lbuf,"A") == 0) {
- mdmstat = CONNECTED; /* Attached */
- dialsta = DIA_OK;
- } else if (strcmp(lbuf,"N") == 0) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN; /* No answer or no dialtone */
- } else if (strcmp(lbuf,"E") == 0 || /* Error */
- strcmp(lbuf,"R") == 0) { /* "Ready" (?) */
- mdmstat = D_FAILED;
- dialsta = DIA_ERR; /* Command error */
- }
- /* otherwise fall thru... */
- case n_DF200:
- if (didweget(lbuf,"Attached")) {
- mdmstat = CONNECTED;
- dialsta = DIA_OK;
- /*
- * The DF100 will respond with "Attached" even if DTR
- * and/or carrier are not present. Another reason to
- * (also) wait for carrier?
- */
- } else if (didweget(lbuf,"Busy")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"Disconnected")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DISC;
- } else if (didweget(lbuf,"Error")) {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"No answer")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- } else if (didweget(lbuf,"No dial tone")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"Speed:)")) {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- }
- /*
- * It appears that the "Speed:..." response comes after an
- * "Attached" response, so this is never seen. HOWEVER,
- * it would be very handy to detect this and temporarily
- * reset the speed, since it's a nuisance otherwise.
- * If we wait for some more input from the modem, how do
- * we know if it's from the remote host or the modem?
- * Carrier reportedly doesn't get set until after the
- * "Speed:..." response (if any) is sent. Another reason
- * to (also) wait for carrier.
- */
- break;
- case n_GDC:
- if (didweget(lbuf,"ON LINE"))
- mdmstat = CONNECTED;
- else if (didweget(lbuf,"NO CONNECT"))
- mdmstat = D_FAILED;
- break;
- case n_PENRIL:
- if (didweget(lbuf,"OK")) {
- mdmstat = CONNECTED;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"NO RING")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- }
- break;
- case n_RACAL:
- if (didweget(lbuf,"ON LINE"))
- mdmstat = CONNECTED;
- else if (didweget(lbuf,"FAILED CALL"))
- mdmstat = D_FAILED;
- break;
- #endif /* OLDMODEMS */
- case n_ROLM:
- if (didweget(lbuf,"CALLING"))
- mdmstat = 0;
- else if (didweget(lbuf,"COMPLETE"))
- mdmstat = CONNECTED;
- else if (didweget(lbuf,"FAILED") ||
- didweget(lbuf,"ABANDONDED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (didweget(lbuf,"NOT AVAILABLE") ||
- didweget(lbuf,"LACKS PERMISSION") ||
- didweget(lbuf,"NOT A DATALINE") ||
- didweget(lbuf,"INVALID DATA LINE NUMBER") ||
- didweget(lbuf,"INVALID GROUP NAME")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAC;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"DOES NOT ANSWER")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- }
- break;
- #ifdef OLDMODEMS
- case n_VENTEL:
- if (didweget(lbuf,"ONLINE!") ||
- didweget(lbuf,"Online!")) {
- mdmstat = CONNECTED;
- } else if (didweget(lbuf,"BUSY") ||
- didweget(lbuf,"Busy")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"DEAD PHONE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DISC;
- }
- break;
- case n_CONCORD:
- if (didweget(lbuf,"INITIATING"))
- mdmstat = CONNECTED;
- else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"CALL FAILED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- }
- break;
- #endif /* OLDMODEMS */
- case n_MICROCOM:
- /* "RINGBACK" means phone line ringing, continue */
- if (didweget(lbuf,"NO CONNECT")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"NO DIALTONE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"COMMAND ERROR")) {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"IN USE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAC;
- } else if (didweget(lbuf,"CONNECT")) {
- mdmstat = CONNECTED;
- /* trailing speed ignored */
- }
- break;
- #endif /* MINIDIAL */
- default:
- printf(
- "PROGRAM ERROR - No response handler for modem type %d\n",
- mymdmtyp);
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- }
- }
- } /* while (mdmstat == 0) */
- debug(F101,"_dodial alarm off","",x);
- alarm(0);
- if (mdmstat == D_FAILED) { /* Failure detected by modem */
- dialfail(F_MODEM);
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- } else if (mdmstat == D_PARTIAL ) { /* Partial dial command OK */
- msleep(500);
- debug(F100,"dial partial","",0);
- } else { /* Call was completed */
- int x;
- msleep(700); /* In case modem signals blink */
- debug(F100,"dial succeeded","",0);
- if (
- #ifndef MINIDIAL
- mymdmtyp != n_ROLM /* Rolm has weird modem signaling */
- #else
- 1
- #endif /* MINIDIAL */
- ) {
- alarm(3); /* In case ttpkt() gets stuck... */
- ttpkt(speed,FLO_DIAX,parity); /* Cancel dialing state ioctl */
- alarm(0);
- }
- /*
- In case CD went off in the interval between call completion and return
- from ttpkt()...
- */
- if (carrier != CAR_OFF) {
- if ((x = ttgmdm()) >= 0) {
- #ifdef TN_COMPORT
- if (istncomport() && !(x & BM_DCD)) {
- int i;
- for (i = 0; i < 5; i++) {
- msleep(500);
- tnc_wait((CHAR *)"_dodial waiting for DCD",1);
- if ((x = ttgmdm()) >= 0) {
- if ((x & BM_DCD))
- break;
- }
- }
- }
- #endif /* TN_COMPORT */
- if (!(x & BM_DCD))
- printf("WARNING: Carrier seems to have dropped...\n");
- }
- }
- }
- dreset(); /* Reset alarms and signals. */
- if (!quiet && !backgrd) {
- if (dialdpy && (p = ck_time())) { /* If DIAL DISPLAY ON, */
- printf(" %sall complete: %s.\n", /* include timestamp. */
- (mdmstat == D_PARTIAL) ?
- "Partial c" :
- "C",
- p );
- } else if (modemmsg[0]) {
- printf (" %sall complete: \"%s\".\n",
- (mdmstat == D_PARTIAL) ? "Partial c" : "C",
- (char *)modemmsg
- );
- } else {
- printf (" %sall complete.\n",
- (mdmstat == D_PARTIAL) ?
- "Partial c" :
- "C"
- );
- }
- }
- #ifdef CKLOGDIAL
- dologdial(telnbr);
- #endif /* CKLOGDIAL */
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- dialsta = (mdmstat == D_PARTIAL) ? DIA_PART : DIA_OK;
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- }
- static SIGTYP
- #ifdef CK_ANSIC
- faildial(void * threadinfo)
- #else /* Not CK_ANSIC */
- faildial(threadinfo) VOID * threadinfo;
- #endif /* CK_ANSIC */
- /* faildial */ {
- debug(F100,"longjmp returns to dial routine","",0);
- dialfail(fail_code);
- SIGRETURN;
- }
- /*
- nbr = number to dial (string)
- x1 = Retry counter
- x2 = Number counter
- fc = Function code:
- 0 == DIAL
- 1 == ANSWER
- 2 == INIT/CONFIG
- 3 == PARTIAL DIAL
- */
- int
- #ifdef OLD_DIAL
- ckdial(nbr) char *nbr;
- #else
- ckdial(nbr, x1, x2, fc, redial) char *nbr; int x1, x2, fc, redial;
- #endif /* OLD_DIAL */
- /* ckdial */ {
- #define ERMSGL 50
- char errmsg[ERMSGL], *erp; /* For error messages */
- int n = F_TIME;
- char *s;
- long spdmax;
- #ifdef OS2
- extern int term_io;
- int term_io_sav = term_io;
- #endif /* OS2 */
- char *mmsg = "Sorry, DIAL memory buffer can't be allocated\n";
- /*
- A DIAL command implies a SET MODEM TYPE command and therefore enables
- hanging up by modem commands rather than dropping DTR.
- */
- mdmset = 1; /* See mdmhup() */
- partial = 0;
- if (fc == 3) { /* Partial dial requested */
- partial = 1; /* Set flag */
- fc = 0; /* Treat like regular dialing */
- }
- func_code = fc; /* Make global to this module */
- telnbr = nbr;
- xredial = redial;
- debug(F111,"ckdial entry partial",ckitoa(fc),partial);
- debug(F111,"ckdial entry number",nbr,redial);
- if (fc == 1) { /* ANSWER command? */
- /* Reset caller ID strings */
- if (callid_date) makestr(&callid_date,NULL);
- if (callid_time) makestr(&callid_time,NULL);
- if (callid_name) makestr(&callid_name,NULL);
- if (callid_nmbr) makestr(&callid_nmbr,NULL);
- if (callid_mesg) makestr(&callid_mesg,NULL);
- }
- #ifdef CK_TAPI_X
- if (tttapi && tapipass) {
- if (modemp[n_TAPI] = cktapiGetModemInf()) {
- mymdmtyp = n_TAPI;
- } else {
- mymdmtyp = mdmtyp;
- modemp[n_TAPI] = &GENERIC;
- }
- } else
- #endif /* CK_TAPI */
- mymdmtyp = mdmtyp;
- if (mymdmtyp < 0) { /* Whoa, network dialing... */
- if (mdmsav > -1)
- mymdmtyp = mdmsav;
- }
- if (mymdmtyp < 0) {
- printf("Invalid modem type %d - internal error.\n",mymdmtyp);
- dialsta = DIA_NOMO;
- return(0);
- }
- dial_what = DW_NOTHING; /* Doing nothing at first. */
- nonverbal = 0;
- /* These are ONLY for the purpose of interpreting numeric result codes. */
- is_motorola =
- #ifdef MINIDIAL
- 0
- #else
- mymdmtyp == n_SUPRA || mymdmtyp == n_SUPRASON;
- #endif /* MINIDIAL */
- ;
- is_motorola =
- #ifdef MINIDIAL
- 0
- #else
- mymdmtyp == n_MOTOROLA || mymdmtyp == n_MONTANA;
- #endif /* MINIDIAL */
- ;
- is_rockwell =
- #ifdef MINIDIAL
- 0
- #else
- mymdmtyp == n_RWV32 || mymdmtyp == n_RWV32B ||
- mymdmtyp == n_RWV34 || mymdmtyp == n_RWV90 ||
- mymdmtyp == n_BOCA || mymdmtyp == n_TELEPATH ||
- mymdmtyp == n_CARDINAL || mymdmtyp == n_BESTDATA ||
- mymdmtyp == n_CONEXANT || mymdmtyp == n_PCTEL
- #endif /* MINIDIAL */
- ;
- is_hayeshispd =
- #ifdef MINIDIAL
- 0
- #else
- mymdmtyp == n_H_ULTRA || mymdmtyp == n_H_ACCURA || n_PPI
- #endif /* MINIDIAL */
- ;
- is_supra =
- #ifdef MINIDIAL
- 0
- #else
- mymdmtyp == n_SUPRA || mymdmtyp == n_SUPRAX || n_SUPRASON
- #endif /* MINIDIAL */
- ;
- mp = modemp[mymdmtyp]; /* Set pointer to modem info */
- if (!mp) {
- printf("Sorry, handler for this modem type not yet filled in.\n");
- dialsta = DIA_NOMO;
- return 0;
- }
- debug(F110,"dial number",telnbr,0);
- #ifdef COMMENT
- debug(F110,"dial prefix",(dialnpr ? dialnpr : ""), 0);
- #endif /* COMMENT */
- #ifdef DYNAMIC
- *lbuf = NUL;
- debug(F101,"DIAL lbuf malloc ok","",LBUFL+1);
- if (!rbuf) { /* This one might already have been allocated by getok() */
- if (!(rbuf = malloc(RBUFL+1))) { /* Allocate input line buffer */
- printf("%s", mmsg);
- dialsta = DIA_IE;
- return 0;
- } else
- debug(F101,"DIAL rbuf malloc ok","",RBUFL+1);
- }
- if (!(fbuf = malloc(FULLNUML+1))) { /* Allocate input line buffer */
- printf("%s", mmsg);
- dialsta = DIA_IE;
- if (rbuf) free(rbuf); rbuf = NULL;
- return 0;
- }
- debug(F101,"DIAL fbuf malloc ok","",FULLNUML+1);
- #endif /* DYNAMIC */
- /* NOTE: mdmtyp, not mymdmtyp */
- if (ttopen(ttname,&local,mdmtyp,0) < 0) { /* Open, no carrier wait */
- erp = errmsg;
- if ((int)strlen(ttname) < (ERMSGL - 18)) /* safe, checked */
- sprintf(erp,"Sorry, can't open %s",ttname);
- else
- sprintf(erp,"Sorry, can't open device");
- perror(errmsg);
- dialsta = DIA_OPEN;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- return 0;
- }
- #ifdef CK_TAPI
- if (!tttapi) {
- #endif /* CK_TAPI */
- /* Condition console terminal and communication line */
- /* Place line into "clocal" dialing state, */
- /* important mainly for System V UNIX. */
- if (ttpkt(speed,FLO_DIAL,parity) < 0) {
- ttclos(0); /* If ttpkt fails do all this... */
- if (ttopen(ttname,&local,mymdmtyp,0) < 0) {
- erp = errmsg;
- if ((int)strlen(ttname) < (ERMSGL - 18)) /* safe, checked */
- sprintf(erp,"Sorry, can't reopen %s",ttname);
- else
- sprintf(erp,"Sorry, can't reopen device");
- perror(errmsg);
- dialsta = DIA_OPEN;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- return 0;
- } /* And try again. */
- if ((ttpkt(speed,FLO_DIAL,parity) < 0)
- #ifdef UNIX
- && (strcmp(ttname,"/dev/null"))
- #else
- #ifdef OSK
- && (strcmp(ttname,"/nil"))
- #endif /* OSK */
- #endif /* UNIX */
- #ifdef CK_TAPI
- && !tttapi
- #endif /* CK_TAPI */
- ) {
- printf("Sorry, Can't condition communication line\n");
- printf("Try 'set line %s' again\n",ttname);
- dialsta = DIA_OPEN;
- #ifdef DYNAMIC
- if (rbuf) free(rbuf); rbuf = NULL;
- if (fbuf) free(fbuf); fbuf = NULL;
- #endif /* DYNAMIC */
- return 0;
- }
- }
- #ifdef CK_TAPI
- }
- #endif /* CK_TAPI */
- /* Modem's escape sequence... */
- if (dialesc < 0 || dialesc > 127)
- c = NUL;
- else
- c = (char) (dialesc ? dialesc : mp->esc_char);
- mdmcapas = dialcapas ? dialcapas : mp->capas;
- xx_ok = mp->ok_fn; /* Pointer to response reader */
- if (mdmcapas & CKD_AT) { /* Hayes compatible */
- escbuf[0] = c;
- escbuf[1] = c;
- escbuf[2] = c;
- escbuf[3] = NUL;
- /* In case this modem type is user-defined */
- if (!xx_ok) xx_ok = getok;
- } else { /* Other */
- escbuf[0] = c;
- escbuf[1] = NUL;
- /* In case user-defined */
- if (mdmcapas & CKD_V25) if (!xx_ok) xx_ok = getok;
- }
- /* Partial dialing */
- if (mdmcapas & CKD_AT
- #ifndef MINIDIAL
- || mymdmtyp == n_MICROCOM
- #endif /* MINIDIAL */
- ) {
- int x;
- x = (int) strlen(telnbr);
- if (x > 0) {
- if (telnbr[x-1] == ';') {
- partial = 1;
- debug(F110,"ckdial sets partial=1:",telnbr,0);
- } else if (partial) {
- ckmakmsg(fbuf,FULLNUML,telnbr,";",NULL,NULL); /* add one */
- telnbr = fbuf;
- }
- }
- }
- msleep(500);
- debug(F101,"ckdial dialtmo","",dialtmo); /* Timeout */
- if (fc == 1) { /* ANSWER */
- waitct = (dialatmo > -1) ? dialatmo : 0;
- } else { /* DIAL */
- if (dialtmo < 1) { /* Automatic computation. */
- #ifdef CK_TAPI
- if (tttapi && !tapipass) {
- waitct = 1 * (int)strlen(telnbr) ; /* Worst case dial time */
- waitct += 60; /* dialtone + completion wait times */
- for (s = telnbr; *s; s++) { /* add in pause characters time */
- if (*s == ',') {
- waitct += 2; /* unless it was changed in the modem */
- } else if (*s == 'W' ||
- *s == 'w' ||
- *s == '$' ||
- *s == '@'
- ) {
- waitct += 8;
- }
- }
- } else {
- #endif /* CK_TAPI */
- waitct = 1 * (int)strlen(telnbr) ;
- /* dialtone + completion wait times */
- waitct += mp->dial_time;
- for (s = telnbr; *s; s++) {
- for (p = mp->pause_chars; *p; p++)
- if (*s == *p) {
- waitct += mp->pause_time;
- break;
- }
- }
- #ifdef CK_TAPI
- }
- #endif /* CK_TAPI */
- } else {
- waitct = dialtmo; /* User-specified timeout */
- }
- debug(F101,"ckdial waitct A","",waitct);
- }
- /*
- waitct is our alarm() timer.
- mdmwait is how long we tell the modem to wait for carrier.
- We set mdmwait to be 5 seconds less than waitct, to increase the
- chance that we get a response from the modem before timing out.
- */
- if (waitct <= 0) { /* 0 or negative means wait forever */
- #ifdef COMMENT
- waitct = 254; /* These were backwards in 7.0.196 */
- mdmwait = 0;
- #else
- waitct = 0; /* Fixed in 7.0.198. */
- mdmwait = 254;
- #endif /* COMMENT */
- } else {
- if (dialtmo < 1) { /* Automatic computation. */
- #ifdef XWAITCT
- /* Addtl wait slop can be defined at compile time */
- waitct += XWAITCT;
- #endif /* XWAITCT */
- if (waitct < 60 + mdmwaitd)
- waitct = 60 + mdmwaitd;
- }
- if (mdmcapas & CKD_AT) { /* AT command-set modems */
- mdmwait = waitct; /* S7 timeout = what user asked for */
- waitct += mdmwaitd; /* Kermit timeout a bit later */
- } else { /* Non-AT */
- mdmwait = waitct; /* no difference */
- }
- }
- debug(F101,"ckdial waitct B","",waitct);
- if (fc == 1) { /* ANSWER */
- #ifdef COMMENT
- /*
- This is wrong. mdmwait is the value given to S7 in Hayeslike modems.
- When in autoanswer mode, this is the amount of time the modem waits for
- carrier once ringing starts. Whereas waitct is the timeout given to the
- ANSWER command, which is an entirely different thing. Since the default
- ANSWER timeout is 0 (meaning "wait forever"), the following statement sets
- S7 to 0, which, on some modems (like the USR Sportster) makes it hang up
- and report NO CARRIER the instant the phone rings.
- */
- mdmwait = waitct;
- #else
- if (mdmwait <= 0)
- mdmwait = 60; /* Always wait 60 seconds. */
- #endif /* COMMENT */
- }
- if (!quiet && !backgrd) { /* Print information messages. */
- #ifdef VMS
- printf(" \n");
- fflush(stdout);
- #endif /* VMS */
- if (fc == 1)
- printf(" Waiting for phone call...\n");
- else
- printf(" %srying: %s...\n", x1 > 0 ? "Ret" : "T", telnbr);
- if (x1 == 0 && x2 == 0 && dialsta != DIA_PART) {
- if (network) {
- printf(" Via modem server: %s, modem: %s\n",
- ttname, gmdmtyp() );
- } else {
- #ifdef CK_TAPI
- if (tttapi && !tapipass)
- printf(" Device: %s, modem: %s", ttname, "TAPI" );
- else
- #endif /* CK_TAPI */
- printf(" Device: %s, modem: %s",
- ttname, gmdmtyp() );
- if (speed > -1L)
- printf(", speed: %ld\n", speed);
- else
- printf(", speed: (unknown)\n");
- }
- spdmax = dialmax > 0L ? dialmax : mp->max_speed;
- #ifndef NOHINTS
- if (hints && !quiet &&
- !network && spdmax > 0L && speed > spdmax
- #ifdef CK_TAPI
- && (!tttapi || tapipass)
- #endif /* CK_TAPI */
- ) {
- printf("\n*************************\n");
- printf(
- "Interface speed %ld might be too high for this modem type.\n",
- speed
- );
- printf(
- "If dialing fails, SET SPEED to %ld or less and try again.\n",
- spdmax
- );
- printf("(Use SET HINTS OFF to suppress future hints.)\n");
- printf("*************************\n");
- printf("\n");
- }
- #endif /* NOHINTS */
- printf(" %s timeout: ", fc == 0 ? "Dial" : "Answer");
- if (waitct > 0)
- printf("%d seconds\n",mdmwait);
- else
- printf(" (none)\n");
- printf(
- #ifdef MAC
- " Type Command-. to cancel.\n"
- #else
- #ifdef UNIX
- " To cancel: type your interrupt character (normally Ctrl-C).\n"
- #else
- " To cancel: type Ctrl-C (hold down Ctrl, press C).\n"
- #endif /* UNIX */
- #endif /* MAC */
- );
- }
- }
- debug(F111,"ckdial",ttname,(int) (speed / 10L));
- debug(F101,"ckdial timeout","",waitct);
- #ifdef OS2
- term_io = 0;
- #endif /* OS2 */
- /* Set timer and interrupt handlers. */
- savint = signal( SIGINT, dialint ) ; /* And terminal interrupt handler. */
- cc_alrm_execute(ckjaddr(sjbuf), 0, dialtime, _dodial, faildial);
- signal(SIGINT, savint);
- #ifdef OS2
- if (dialsta == DIA_OK) /* Dialing is completed */
- DialerSend(OPT_KERMIT_CONNECT, 0);
- term_io = term_io_sav;
- #endif /* OS2 */
- if (dialsta == DIA_PART || dialsta == DIA_OK) {
- /* This is needed, e.g., for Telnet modem servers */
- if (reliable != SET_OFF || !setreliable) {
- reliable = SET_OFF; /* Transport is not reliable */
- debug(F101,"ckdial reliable","",reliable);
- }
- return(1); /* Dial attempt succeeded */
- } else {
- return(0); /* Dial attempt failed */
- }
- } /* ckdial */
- /*
- getok() - wait up to n seconds for OK (0) or ERROR (4) response from modem.
- Use with Hayeslike or CCITT modems for reading the reply to a nondialing
- command.
- Second argument says whether to be strict about numeric result codes, i.e.
- to require they be preceded by CR or else be the first character in the
- response, e.g. to prevent the ATH0<CR> echo from looking like a valid
- response. Strict == 0 is needed for ATI on Telebit, which can return the
- model number concatenated with the numeric response code, e.g. "9620"
- ("962" is the model number, "0" is the response code). getok() Returns:
- 0 if it timed out,
- 1 if it succeeded,
- -1 on modem command, i/o, or other error.
- */
- static ckjmpbuf okbuf;
- static SIGTYP
- #ifdef CK_ANSIC
- oktimo(int foo) /* Alarm handler for getok(). */
- #else
- oktimo(foo) int foo; /* Alarm handler for getok(). */
- #endif /* CK_ANSIC */
- /* oktimo */ {
- #ifdef OS2
- alarm(0);
- /* signal(SIGALRM,SIG_IGN); */
- debug(F100,"oktimo() SIGALRM caught -- SIG_IGN set","",0) ;
- #endif /* OS2 */
- #ifdef OSK /* OS-9, see comment in dialtime(). */
- sigmask(-1);
- #endif /* OSK */
- #ifdef NTSIG
- if ( foo == SIGALRM )
- PostAlarmSigSem();
- else
- PostCtrlCSem();
- #else /* NTSIG */
- #ifdef NT
- cklongjmp(ckjaddr(okbuf),1);
- #else /* NT */
- cklongjmp(okbuf,1);
- #endif /* NTSIG */
- #endif /* NT */
- /* NOTREACHED */
- SIGRETURN;
- }
- static int okstatus, okn, okstrict;
- static SIGTYP
- #ifdef CK_ANSIC
- dook(void * threadinfo)
- #else /* CK_ANSIC */
- dook(threadinfo) VOID * threadinfo ;
- #endif /* CK_ANSIC */
- /* dook */ {
- CHAR c;
- #ifdef DEBUG
- char * mdmmsg = "";
- #endif /* DEBUG */
- int i, x;
- #ifdef IKSD
- extern int inserver;
- #endif /* IKSD */
- #ifdef NTSIG
- signal(SIGINT,oktimo);
- if (threadinfo) { /* Thread local storage... */
- TlsSetValue(TlsIndex,threadinfo);
- }
- #endif /* NTSIG */
- #ifdef CK_LOGIN
- #ifdef NT
- #ifdef IKSD
- if (inserver)
- setntcreds();
- #endif /* IKSD */
- #endif /* NT */
- #endif /* CK_LOGIN */
- if (mdmcapas & CKD_V25) { /* CCITT, easy... */
- waitfor("VAL");
- okstatus = 1;
- debug(F111,"Modem_Response(V25)","VAL",okstatus);
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- #ifndef MINIDIAL
- } else if (mymdmtyp == n_MICROCOM) { /* Microcom in SX mode, also easy */
- waitfor(MICROCOM.wake_prompt); /* (I think...) */
- debug(F111,"Modem_Response(Microcom)",MICROCOM.wake_prompt,okstatus);
- okstatus = 1;
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- #endif /* MINIDIAL */
- } else { /* Hayes & friends, start here... */
- okstatus = 0; /* No status yet. */
- for (x = 0; x < RBUFL; x++) /* Initialize response buffer */
- rbuf[x] = SP; /* to all spaces */
- rbuf[RBUFL] = NUL; /* and terminate with NUL. */
- while (okstatus == 0) { /* While no status... */
- x = ddinc(okn); /* Read a character */
- if (x < 0) { /* I/O error */
- okstatus = -1;
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- }
- #ifdef COMMENT
- /* too much */
- debug(F101,"getok ddinc","",x); /* Got a character. */
- #endif /* COMMENT */
- c = (char) (x & 0x7f); /* Get low order 7 bits */
- if (!c) /* Don't deposit NULs */
- continue; /* or else didweget() won't work */
- if (dialdpy) conoc((char)c); /* Echo it if requested */
- for (i = 0; i < RBUFL-1; i++) /* Rotate buffer */
- rbuf[i] = rbuf[i+1];
- rbuf[RBUFL-1] = c; /* Deposit character at end */
- #ifdef COMMENT
- /* too much */
- debug(F000,"getok:",rbuf,(int) c); /* Log it */
- #endif /* COMMENT */
- switch (c) { /* Interpret it. */
- case CR: /* Got a carriage return. */
- switch(rbuf[RBUFL-2]) { /* Look at character before it. */
- case '0': /* 0 = OK numeric response */
- if (!okstrict ||
- rbuf[RBUFL-3] == CR || rbuf[RBUFL-3] == SP) {
- nonverbal = 1;
- okstatus = 1; /* Good response */
- }
- debug(F111,"Modem_Response(Hayes)","0",okstatus);
- break;
- case '4': /* 4 = ERROR numeric response */
- #ifndef MINIDIAL
- /* Or Telebit model number 964! */
- if (mymdmtyp == n_TELEBIT &&
- isdigit(rbuf[RBUFL-3]) &&
- isdigit(rbuf[RBUFL-4]))
- break;
- else
- #endif /* MINIDIAL */
- if (!okstrict ||
- rbuf[RBUFL-3] == CR || rbuf[RBUFL-3] == SP) {
- nonverbal = 1;
- okstatus = -1; /* Bad command */
- }
- debug(F111,"Modem_Response(Hayes)","4",okstatus);
- break;
- }
- if (dialdpy && nonverbal) /* If numeric results, */
- conoc(LF); /* echo a linefeed too. */
- break;
- case LF: /* Got a linefeed. */
- /*
- Note use of explicit octal codes in the string for
- CR and LF. We want real CR and LF here, not whatever
- the compiler happens to replace \r and \n with...
- */
- if (!strcmp(rbuf+RBUFL-4,"OK\015\012")) { /* Good response */
- okstatus = 1;
- debug(F111,"Modem_Response(Hayes)","OK",okstatus);
- }
- if (!strcmp(rbuf+RBUFL-3,"OK\012")) { /* Good response */
- okstatus = 1;
- debug(F111,"Modem_Response(Hayes)","OK",okstatus);
- } else if (!strcmp(rbuf+RBUFL-7,"ERROR\015\012")) { /* Error */
- okstatus = -1;
- debug(F111,"Modem_Response(Hayes)","ERROR",okstatus);
- } else if (!strcmp(rbuf+RBUFL-6,"ERROR\012")) { /* Error */
- okstatus = -1;
- debug(F111,"Modem_Response(Hayes)","ERROR",okstatus);
- }
- break;
- /* Check whether modem echoes its commands... */
- case 't': /* Got little t */
- if (!strcmp(rbuf+RBUFL-3,"\015at") || /* See if it's "at" */
- !strcmp(rbuf+RBUFL-3," at"))
- mdmecho = 1;
- /* debug(F111,"MDMECHO-t",rbuf+RBUFL-2,mdmecho); */
- break;
- case 'T': /* Got Big T */
- if (!strcmp(rbuf+RBUFL-3,"\015AT") || /* See if it's "AT" */
- !strcmp(rbuf+RBUFL-3," AT"))
- mdmecho = 1;
- /* debug(F111,"MDMECHO-T",rbuf+RBUFL-3,mdmecho); */
- break;
- default: /* Other characters, accumulate. */
- okstatus = 0;
- break;
- }
- }
- }
- debug(F101,"getok","",okstatus); /* <-- It's a lie (why?) */
- #ifdef NTSIG
- ckThreadEnd(threadinfo);
- #endif /* NTSIG */
- SIGRETURN;
- }
- static SIGTYP
- #ifdef CK_ANSIC
- failok(void * threadinfo)
- #else /* CK_ANSIC */
- failok(threadinfo) VOID * threadinfo;
- #endif /* CK_ANSIC */
- /* failok */ {
- debug(F100,"longjmp returned to getok()","",0);
- debug(F100,"getok timeout","",0);
- SIGRETURN;
- }
- int
- getok(n, strict) int n, strict; {
- debug(F101,"getok entry n","",n);
- okstatus = 0;
- okn = n;
- okstrict = strict;
- #ifdef DYNAMIC
- if (!rbuf) {
- if (!(rbuf = malloc(RBUFL+1))) { /* Allocate input line buffer */
- dialsta = DIA_IE;
- return(-1);
- }
- debug(F101,"GETOK rbuf malloc ok","",RBUFL+1);
- }
- #endif /* DYNAMIC */
- mdmecho = 0; /* Assume no echoing of commands */
- debug(F100,"about to alrm_execute dook()","",0);
- alrm_execute( ckjaddr(okbuf), n, oktimo, dook, failok ) ;
- debug(F100,"returning from alrm_execute dook()","",0);
- ttflui(); /* Flush input buffer */
- return(okstatus); /* Return status */
- }
- /* G E T H R N -- Get Hayes Result Numeric */
- static VOID
- gethrn() {
- char c;
- int x;
- /*
- Hayes numeric result codes (Hayes 1200 and higher):
- 0 = OK
- 1 = CONNECT at 300 bps (or 1200 bps on Hayes 1200 with basic code set)
- 2 = RING
- 3 = NO CARRIER
- 4 = ERROR (in command line)
- 5 = CONNECT 1200 (extended code set)
- Hayes 2400 and higher:
- 6 = NO DIALTONE
- 7 = BUSY
- 8 = NO ANSWER
- 9 = (there is no 9)
- 10 = CONNECT 2400
- Reportedly, the codes for Hayes V.32 modems are:
- 1x = CONNECT <suffix>
- 5x = CONNECT 1200 <suffix>
- 9x = CONNECT 2400 <suffix>
- 11x = CONNECT 4800 <suffix>
- 12x = CONNECT 9600 <suffix>
- Where:
- x: suffix:
- R = RELIABLE
- RC = RELIABLE COMPRESSED
- L = LAPM
- LC = LAPM COMPRESSED
- And for Telebits, all the above, except no suffix in numeric mode, plus:
- 11 = CONNECT 4800
- 12 = CONNECT 9600
- 13 = CONNECT 14400
- 14 = CONNECT 19200
- 15 = CONNECT 38400
- 16 = CONNECT 57600
- 20 = CONNECT 300/REL (= MNP)
- 22 = CONNECT 1200/REL (= MNP)
- 23 = CONNECT 2400/REL (= MNP)
- 46 = CONNECT 7512 (i.e. 75/1200)
- 47 = CONNECT 1275 (i.e. 1200/75)
- 48 = CONNECT 7200
- 49 = CONNECT 12000
- 50 = CONNECT FAST (not on T1600/3000)
- 52 = RRING
- 53 = DIALING
- 54 = NO PROMPTTONE
- 61 = CONNECT FAST/KERM (Kermit spoof)
- 70 = CONNECT FAST/COMP (PEP + compression)
- 71 = CONNECT FAST/KERM/COMP (PEP + compression + Kermit spoof)
- And for others, lots of special cases below...
- */
- #define NBUFL 8
- char nbuf[NBUFL+1]; /* Response buffer */
- int i = 0, j = 0; /* Buffer pointers */
- debug(F101,"RESPONSE mdmecho","",mdmecho);
- if (mdmecho) { /* Sponge up dialing string echo. */
- while (1) {
- c = (char) (ddinc(0) & 0x7f);
- debug(F000,"SPONGE","",c);
- dialoc(c);
- if (c == CR) break;
- }
- }
- while (mdmstat == 0) { /* Read response */
- for (i = 0; i < NBUFL; i++) /* Clear the buffer */
- nbuf[i] = '\0';
- i = 0; /* Reset the buffer pointer. */
- c = (char) (ddinc(0) & 0177); /* Get first digit of response. */
- /* using an untimed, blocking read. */
- debug(F000,"RESPONSE-A","",c);
- dialoc(c); /* Echo it if requested. */
- if (!isdigit(c)) /* If not a digit, keep looking. */
- continue;
- nbuf[i++] = c; /* Got first digit, save it. */
- while (c != CR && i < 8) { /* Read chars up to CR */
- x = ddinc(0) & 0177; /* Get a character. */
- c = (char) x; /* Got it OK. */
- debug(F000,"RESPONSE-C","",c);
- if (c != CR) /* If it's not a carriage return, */
- nbuf[i++] = c; /* save it. */
- dialoc(c); /* Echo it. */
- }
- nbuf[i] = '\0'; /* Done, terminate the buffer. */
- debug(F110,"dial hayesnv lbuf",lbuf,0);
- debug(F111,"dial hayesnv got",nbuf,i);
- /*
- Separate any non-numeric suffix from the numeric
- result code with a null.
- */
- for (j = i-1; (j > -1) && !isdigit(nbuf[j]); j--)
- nbuf[j+1] = nbuf[j];
- j++;
- nbuf[j++] = '\0';
- debug(F110,"dial hayesnv numeric",nbuf,0);
- debug(F111,"dial hayesnv suffix ",nbuf+j,j);
- /* Probably phone number echoing. */
- if ((int)strlen(nbuf) > 3)
- continue;
- /* Now read and interpret the results... */
- i = atoi(nbuf); /* Convert to integer */
- switch (i) {
- case 0:
- mdmstat = D_PARTIAL; /* OK response */
- break;
- case 1: /* CONNECT */
- mdmstat = CONNECTED; /* Could be any speed */
- break;
- case 2: /* RING */
- if (dialdpy)
- printf("\r\n Local phone is ringing!\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_RING;
- break;
- case 3: /* NO CARRIER */
- if (dialdpy) printf("\r\n No Carrier.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- break;
- case 4: /* ERROR */
- if (dialdpy)
- printf("\r\n Modem Command Error.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- break;
- case 5: /* CONNECT 1200 */
- spdchg(1200L); /* Change speed if necessary. */
- mdmstat = CONNECTED;
- break;
- case 6: /* NO DIALTONE */
- #ifndef MINIDIAL
- if (mymdmtyp == n_MICROLINK && atoi(diallcc) == 49 && dialdpy)
- printf("\r\n Dial Locked.\r\n"); /* Germany */
- else
- #endif /* MINIDIAL */
- if (dialdpy)
- printf("\r\n No Dialtone.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- break;
- case 7: /* BUSY */
- if (dialdpy) printf("\r\n Busy.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- break;
- case 8: /* NO ANSWER */
- #ifndef MINIDIAL
- if (mymdmtyp == n_MICROLINK && atoi(diallcc) == 41 && dialdpy)
- printf("\r\n Dial Locked.\r\n"); /* Switzerland */
- else
- #endif /* MINIDIAL */
- if (dialdpy)
- printf("\r\n No Answer.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- break;
- case 9:
- #ifndef MINIDIAL
- if (mymdmtyp == n_XJACK || mymdmtyp == n_SUPRAX) {
- spdchg(600);
- break;
- } /* fall thru */
- #endif /* MINIDIAL */
- case 10: /* CONNECT 2400 */
- spdchg(2400L); /* Change speed if necessary. */
- mdmstat = CONNECTED;
- break;
- #ifndef MINIDIAL
- /* Starting here, we get different meanings from different manufacturers */
- case 11:
- if (mymdmtyp == n_USR) {
- if (dialdpy) printf(" Ringing...\r\n");
- } else {
- spdchg(4800L); /* CONNECT 4800 */
- mdmstat = CONNECTED;
- }
- break;
- case 12:
- if (mymdmtyp == n_USR) {
- if (dialdpy)
- printf("\r\n Answered by voice.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_VOIC;
- } else if (mymdmtyp == n_KEEPINTOUCH) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- } else {
- spdchg(9600L);
- mdmstat = CONNECTED;
- }
- break;
- case 13:
- if (mymdmtyp == n_ATT1900 || mymdmtyp == n_ATT1910) {
- if (dialdpy) printf(" Wait...\r\n");
- break;
- } else if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
- spdchg(9600L);
- else if (is_rockwell || is_supra ||
- mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
- spdchg(7200L);
- else if (mymdmtyp != n_MICROLINK)
- spdchg(14400L);
- mdmstat = CONNECTED;
- break;
- case 14:
- if (is_rockwell || is_supra || mymdmtyp == n_XJACK)
- spdchg(12000L);
- else if (mymdmtyp == n_DATAPORT || mymdmtyp == n_MICROLINK)
- spdchg(14400L);
- else if (mymdmtyp == n_KEEPINTOUCH)
- spdchg(9600L);
- else if (mymdmtyp != n_USR && mymdmtyp != n_ZOLTRIX)
- spdchg(19200L);
- mdmstat = CONNECTED;
- break;
- case 15:
- if (is_rockwell || is_supra ||
- mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
- spdchg(14400L);
- else if (mymdmtyp == n_USR)
- spdchg(1200L);
- else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
- spdchg(7200L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(19200L);
- else
- spdchg(38400L);
- mdmstat = CONNECTED;
- break;
- case 16:
- if (is_rockwell || is_supra ||
- mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK)
- spdchg(19200L);
- else if (mymdmtyp == n_USR)
- spdchg(2400L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(7200L);
- else if (mymdmtyp != n_ZYXEL && mymdmtyp != n_INTEL) /* 12000 */
- spdchg(57600L);
- mdmstat = CONNECTED;
- break;
- case 17:
- if (mymdmtyp != n_DATAPORT || mymdmtyp == n_XJACK) /* 16800 */
- spdchg(38400L);
- else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
- spdchg(14400L);
- else if (mymdmtyp == n_KEEPINTOUCH)
- spdchg(14400L);
- else if (mymdmtyp == n_USR)
- spdchg(9600L);
- mdmstat = CONNECTED;
- break;
- case 18:
- if (is_rockwell || is_supra ||
- mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK ||
- mymdmtyp == n_MHZATT || mymdmtyp == n_LUCENT)
- spdchg(57600L);
- else if (mymdmtyp == n_INTEL)
- spdchg(19200L);
- else if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
- spdchg(4800L);
- mdmstat = CONNECTED;
- break;
- case 19:
- if (mymdmtyp == n_DATAPORT)
- spdchg(300L);
- else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
- spdchg(38400L);
- else
- spdchg(115200L);
- mdmstat = CONNECTED;
- break;
- case 20:
- if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
- spdchg(7200L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(2400L);
- else if (mymdmtyp == n_ZYXEL || mymdmtyp == n_INTEL)
- spdchg(57600L);
- else
- spdchg(300L);
- mdmstat = CONNECTED;
- break;
- case 21:
- if (mymdmtyp == n_DATAPORT)
- spdchg(4800L);
- mdmstat = CONNECTED;
- break;
- case 22:
- if (is_rockwell || is_supra || mymdmtyp == n_XJACK)
- spdchg(8880L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(9600L);
- else if (mymdmtyp == n_KEEPINTOUCH)
- spdchg(300L);
- else if (!is_hayeshispd)
- spdchg(1200L);
- mdmstat = CONNECTED;
- break;
- case 23:
- if (is_hayeshispd || is_supra ||
- mymdmtyp == n_MULTI || mymdmtyp == n_XJACK)
- spdchg(8880L);
- else if (mymdmtyp != n_DATAPORT && !is_rockwell) /* 12000 */
- spdchg(2400L);
- mdmstat = CONNECTED;
- break;
- case 24:
- if (is_rockwell || is_supra || mymdmtyp == n_XJACK) {
- mdmstat = D_FAILED;
- dialsta = DIA_DELA; /* Delayed */
- break;
- } else if (is_hayeshispd || mymdmtyp == n_LUCENT)
- spdchg(7200L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(14400L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(1200L);
- mdmstat = CONNECTED;
- break;
- case 25:
- if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
- spdchg(14400L);
- else if (mymdmtyp == n_LUCENT)
- spdchg(12000L);
- else if (is_motorola)
- spdchg(9600L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(2400L);
- mdmstat = CONNECTED;
- break;
- case 26:
- if (mymdmtyp == n_DATAPORT)
- spdchg(19200L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(4800L);
- mdmstat = CONNECTED;
- break;
- case 27:
- if (mymdmtyp == n_DATAPORT)
- spdchg(38400L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(7200L);
- else if (mymdmtyp == n_MHZATT)
- spdchg(8880L);
- mdmstat = CONNECTED;
- break;
- case 28:
- if (mymdmtyp == n_DATAPORT)
- spdchg(7200L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(9600L);
- else if (mymdmtyp == n_MHZATT || mymdmtyp == n_LUCENT)
- spdchg(38400L);
- mdmstat = CONNECTED;
- break;
- case 29:
- if (is_motorola)
- spdchg(4800L);
- else if (mymdmtyp == n_DATAPORT)
- spdchg(19200L);
- mdmstat = CONNECTED;
- break;
- case 30:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- } /* fall thru on purpose... */
- case 31:
- if (mymdmtyp == n_UCOM_AT || mymdmtyp == n_MICROLINK) {
- spdchg(4800L);
- mdmstat = CONNECTED;
- } else if (is_motorola) {
- spdchg(57600L);
- mdmstat = CONNECTED;
- }
- break;
- case 32:
- if (is_rockwell || is_supra || mymdmtyp == n_XJACK) {
- mdmstat = D_FAILED;
- dialsta = DIA_BLCK; /* Blacklisted */
- } else if (mymdmtyp == n_UCOM_AT || mymdmtyp == n_MICROLINK) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_KEEPINTOUCH) {
- spdchg(300L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- }
- break;
- case 33: /* FAX connection */
- if (is_rockwell || is_supra ||
- mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK) {
- mdmstat = D_FAILED;
- dialsta = DIA_FAX;
- } else if (mymdmtyp == n_UCOM_AT ||
- is_motorola ||
- mymdmtyp == n_MICROLINK
- ) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_MHZATT) {
- spdchg(115200L);
- mdmstat = CONNECTED;
- }
- break;
- case 34:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(1200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_MICROLINK) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- }
- break;
- case 35:
- if (is_rockwell) {
- spdchg(300L);
- dialsta = CONNECTED;
- } else if (is_motorola) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_MICROLINK) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_ZOLTRIX || mymdmtyp == n_XJACK) /* DATA */
- mdmstat = CONNECTED;
- break;
- case 36:
- if (mymdmtyp == n_UCOM_AT) {
- spdchg(19200L);
- mdmstat = CONNECTED;
- } else if (is_motorola) {
- spdchg(1200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(4800L);
- mdmstat = CONNECTED;
- }
- break;
- case 37:
- if (mymdmtyp == n_UCOM_AT) {
- spdchg(19200L);
- mdmstat = CONNECTED;
- } else if (is_motorola) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- }
- break;
- case 38:
- if (is_motorola) {
- spdchg(4800L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- } /* fall thru on purpose... */
- case 39:
- if (mymdmtyp == n_UCOM_AT) {
- spdchg(38400L);
- mdmstat = CONNECTED;
- } else if (is_motorola) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_MICROLINK) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- }
- break;
- case 40:
- if (mymdmtyp == n_UCOM_AT) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (is_motorola || mymdmtyp == n_INTEL ||
- mymdmtyp == n_KEEPINTOUCH) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- }
- break;
- case 41:
- if (is_motorola) {
- spdchg(19200L);
- mdmstat = CONNECTED;
- }
- break;
- case 42:
- if (mymdmtyp == n_KEEPINTOUCH) {
- spdchg(300L);
- mdmstat = CONNECTED;
- } else if (is_motorola) {
- spdchg(38400L);
- mdmstat = CONNECTED;
- } /* fall thru on purpose... */
- case 43:
- if (mymdmtyp == n_UCOM_AT) {
- spdchg(57600L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_USRX2)
- mdmstat = CONNECTED; /* 168000 */
- break;
- case 44:
- if (is_rockwell) {
- spdchg(8800L);
- dialsta = CONNECTED;
- } else if (is_motorola) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(1200L);
- mdmstat = CONNECTED;
- }
- break;
- case 45:
- if (is_motorola) {
- spdchg(57600L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- } else if (n_USR) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- }
- break;
- case 46:
- if (is_rockwell)
- spdchg(1200L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(4800L);
- else
- spdchg(8880L); /* 75/1200 split speed */
- mdmstat = CONNECTED;
- break;
- case 47:
- if (is_rockwell)
- spdchg(2400L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(7200L);
- else
- printf("CONNECT 1200/75 - Not supported by C-Kermit\r\n");
- mdmstat = CONNECTED;
- break;
- case 48:
- if (is_rockwell)
- spdchg(4800L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(9600L);
- else
- spdchg(7200L);
- mdmstat = CONNECTED;
- break;
- case 49:
- if (is_rockwell)
- spdchg(7200L);
- mdmstat = CONNECTED;
- break;
- case 50: /* CONNECT FAST */
- if (is_rockwell)
- spdchg(9600L);
- else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH)
- spdchg(14400L);
- mdmstat = CONNECTED;
- break;
- case 51:
- if (mymdmtyp == n_UCOM_AT) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- }
- break;
- case 52: /* RRING */
- if (mymdmtyp == n_TELEBIT)
- if (dialdpy) printf(" Ringing...\r\n");
- break;
- case 53: /* DIALING */
- if (mymdmtyp == n_TELEBIT)
- if (dialdpy) printf(" Dialing...\r\n");
- break;
- case 54:
- if (is_rockwell) {
- spdchg(19200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(1200L);
- mdmstat = CONNECTED;
- } else if (mymdmtyp == n_TELEBIT) {
- if (dialdpy) printf("\r\n No Prompttone.\r\n");
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- }
- break;
- case 55:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- }
- break;
- case 56:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(4800L);
- mdmstat = CONNECTED;
- }
- break;
- case 57:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- }
- break;
- case 58:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- }
- break;
- case 59:
- if (mymdmtyp == n_INTEL) /* 12000 */
- mdmstat = CONNECTED;
- break;
- case 60:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- }
- break;
- case 64:
- if (mymdmtyp == n_INTEL) {
- spdchg(1200L);
- mdmstat = CONNECTED;
- } else if (is_supra) {
- spdchg(28800L);
- mdmstat = CONNECTED;
- }
- break;
- case 65:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(2400L);
- mdmstat = CONNECTED;
- }
- break;
- case 66:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(4800L);
- mdmstat = CONNECTED;
- }
- break;
- case 67:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(7200L);
- mdmstat = CONNECTED;
- }
- break;
- case 68:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(9600L);
- mdmstat = CONNECTED;
- }
- break;
- case 69:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) /* 12000 */
- mdmstat = CONNECTED;
- break;
- case 70:
- if (mymdmtyp == n_INTEL || mymdmtyp == n_KEEPINTOUCH) {
- spdchg(14400L);
- mdmstat = CONNECTED;
- }
- break;
- case 73:
- if (mymdmtyp == n_UCOM_AT) {
- spdchg(115200L);
- mdmstat = CONNECTED;
- break;
- } /* else fall thru */
- if (mymdmtyp == n_TELEBIT) /* Early models only */
- mdmstat = CONNECTED;
- break;
- case 85:
- if (mymdmtyp == n_USR || mymdmtyp == n_USRX2)
- spdchg(19200L);
- mdmstat = CONNECTED;
- break;
- case 91: /* 21600 */
- case 99: /* 24000 */
- case 103: /* 26400 */
- if (mymdmtyp == n_USRX2)
- mdmstat = CONNECTED;
- break;
- case 107:
- if (mymdmtyp == n_USR || mymdmtyp == n_USRX2) {
- spdchg(28800L);
- mdmstat = CONNECTED;
- }
- break;
- case 151: /* 312000 */
- case 155: /* 336000 */
- if (mymdmtyp == n_USRX2)
- mdmstat = CONNECTED;
- break;
- #endif /* MINIDIAL */
- default:
- #ifndef MINIDIAL
- if (mymdmtyp == n_USR || mymdmtyp == n_USRX2 ||
- is_hayeshispd || is_rockwell)
- #endif /* MINIDIAL */
- if (i > 12) /* There are hundreds of them... */
- mdmstat = CONNECTED;
- break;
- }
- }
- if (mdmstat == CONNECTED && nbuf[j] != '\0') {
- if (dialdpy) {
- printf("\r\n");
- if (nbuf[j] == 'R') printf(" RELIABLE");
- if (nbuf[j] == 'L') printf(" LAPM");
- if (nbuf[j+1] == 'C') printf(" COMPRESSED");
- printf("\r\n");
- }
- ckstrncpy(lbuf,nbuf,LBUFL); /* (for messages...) */
- }
- }
- static VOID /* Get Hayes Result in Word mode */
- gethrw() {
- char *cptr, *s;
- long conspd;
- if (mdmspd && !network) {
- s = lbuf;
- while (*s != '\0' && *s != 'C') s++;
- cptr = (*s == 'C') ? s : NULL;
- conspd = 0L;
- if ((cptr != NULL) && !strncmp(cptr,"CONNECT ",8)) {
- if ((int)strlen(cptr) < 9) /* Just CONNECT, */
- conspd = 300L; /* use 300 bps */
- else if (isdigit(*(cptr+8))) /* not CONNECT FAST */
- conspd = atol(cptr + 8); /* CONNECT nnnn */
- if (conspd != speed) {
- if ((conspd / 10L) > 0) {
- if (ttsspd((int) (conspd / 10L)) < 0) {
- printf(" Can't change speed to %ld\r\n",
- conspd);
- } else {
- speed = conspd;
- mdmstat = CONNECTED;
- if ( !quiet && !backgrd )
- printf(" Speed changed to %ld\r\n",
- conspd);
- }
- }
- } /* Expanded to handle any conceivable speed */
- }
- }
- #ifndef MINIDIAL
- if (mymdmtyp == n_TELEBIT) {
- if (didweget(lbuf,"CONNECT FAST/KERM")) {
- mdmstat = CONNECTED;
- if (dialdpy) printf("FAST/KERM ");
- return;
- }
- }
- #endif /* MINIDIAL */
- if (didweget(lbuf,"RRING") ||
- didweget(lbuf,"RINGING") ||
- didweget(lbuf,"DIALING")) {
- mdmstat = 0;
- } else if (didweget(lbuf,"CONNECT")) {
- mdmstat = CONNECTED;
- } else if (didweget(lbuf,"OK")) {
- if (partial) {
- mdmstat = D_PARTIAL;
- } else {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- }
- } else if (didweget(lbuf,"NO CARRIER")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (didweget(lbuf,"NO DIALTONE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"NO DIAL TONE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"BUSY")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BUSY;
- } else if (didweget(lbuf,"NO ANSWER")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOAN;
- } else if (didweget(lbuf,"VOICE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_VOIC;
- } else if (didweget(lbuf,"VCON")) {
- mdmstat = D_FAILED;
- dialsta = DIA_VOIC;
- } else if (didweget(lbuf,"NO PROMPT TONE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NODT;
- } else if (didweget(lbuf,"REMOTE ACCESS FAILED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_NOCA;
- } else if (didweget(lbuf,"FAX")) {
- mdmstat = D_FAILED;
- dialsta = DIA_FAX;
- } else if (didweget(lbuf,"WAIT - CONNECTING") ||
- didweget(lbuf,"WAIT-CONNECTING")) { /* AT&T STU-III 19xx */
- mdmstat = 0;
- } else if (didweget(lbuf,"DELAYED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DELA;
- } else if (didweget(lbuf,"BLACKLISTED")) {
- mdmstat = D_FAILED;
- dialsta = DIA_BLCK;
- } else if (didweget(lbuf,"COMPRESSION")) {
- mdmstat = 0;
- } else if (didweget(lbuf,"PROTOCOL")) {
- mdmstat = 0;
- } else if (didweget(lbuf,"DIAL LOCKED")) { /* Germany, Austria, Schweiz */
- mdmstat = D_FAILED;
- dialsta = DIA_BLCK;
- } else if ( didweget(lbuf,"RING") ||
- didweget(lbuf,"RING1") || /* Distinctive Ring 1 */
- didweget(lbuf,"RING2") || /* Distinctive Ring 2 */
- didweget(lbuf,"RING3") ) {
- mdmstat = (func_code == 0) ? D_FAILED : 0;
- dialsta = DIA_RING;
- } else if (didweget(lbuf,"ERROR")) {
- mdmstat = D_FAILED;
- dialsta = DIA_ERR;
- } else if (didweget(lbuf,"CARRIER")) { /* Boca / Rockwell family */
- #ifdef COMMENT
- if (is_rockwell)
- #endif /* COMMENT */
- mdmstat = 0;
- #ifdef COMMENT
- /* Does CARRIER ever mean the same as CONNECT? */
- else
- mdmstat = CONNECTED;
- #endif /* COMMENT */
- } else if (didweget(lbuf,"DATA")) { /* Boca / Rockwell family */
- /* This message is sent when the modem is in FAX mode */
- /* So setting this to CONNECTED may not be appropriate */
- /* We must send ATO\015 to the modem in response */
- /* Then we will get a CONNECTED message */
- mdmstat = CONNECTED;
- } else if (didweget(lbuf,"DIGITAL LINE")) {
- mdmstat = D_FAILED;
- dialsta = DIA_DIGI;
- } else if (didweget(lbuf,"DATE")) { /* Caller ID Date */
- debug(F110,"CALLID DATE",lbuf,0);
- /* Format is "DATE = MMDD" */
- makestr(&callid_date,lbuf);
- } else if (didweget(lbuf,"TIME")) { /* Caller ID Time */
- /* Format is "TIME = HHMM" */
- debug(F110,"CALLID TIME",lbuf,0);
- makestr(&callid_time,lbuf);
- } else if (didweget(lbuf,"NAME")) { /* Caller ID Name */
- /* Format is "NAME = <listing name>" */
- debug(F110,"CALLID NAME",lbuf,0);
- makestr(&callid_name,lbuf);
- } else if (didweget(lbuf,"NMBR")) { /* Caller ID Number */
- /* Format is "NMBR = <number>, 'P' or 'O'" */
- /* 'P' means Privacy Requested */
- /* 'O' means Out of Service or Not available */
- debug(F110,"CALLID NMBR",lbuf,0);
- makestr(&callid_nmbr,lbuf);
- } else if (didweget(lbuf,"MESG")) { /* Caller ID Unrecognized Message */
- /* Format is "MESG = <tag><length><data><checksum>" */
- debug(F110,"CALLID MESG",lbuf,0);
- makestr(&callid_mesg,lbuf);
- }
- }
- /* Maybe hang up the phone, depending on various SET DIAL parameters. */
- int
- dialhup() {
- int x = 0;
- if (dialhng && dialsta != DIA_PART) { /* DIAL HANGUP ON? */
- x = mdmhup(); /* Try modem-specific method first */
- debug(F101,"dialhup mdmhup","",x);
- if (x > 0) { /* If it worked, */
- dialsta = DIA_HUP;
- if (dialdpy)
- printf(" Modem hangup OK\r\n"); /* fine. */
- } else if (network /* If we're telnetted to */
- #ifdef TN_COMPORT
- && !istncomport() /* (without RFC 2217) */
- #endif /* TN_COMPORT */
- ) {
- dialsta = DIA_HANG;
- if (dialdpy) /* a modem server, just print a msg */
- printf(" WARNING - modem hangup failed\r\n"); /* don't hangup! */
- return(0);
- } else { /* Otherwise */
- x = tthang(); /* Tell the OS to turn off DTR. */
- if (x > 0) { /* Yes, tell results from tthang() */
- dialsta = DIA_HUP;
- if (dialdpy) printf(" Hangup OK\r\n");
- } else if (x == 0) {
- if (dialdpy) printf(" Hangup skipped\r\n");
- } else {
- dialsta = DIA_HANG;
- if (dialdpy) perror(" Hangup error");
- }
- ttflui();
- }
- } else if (dialdpy) printf(" Hangup skipped\r\n"); /* DIAL HANGUP OFF */
- return(x);
- }
- /*
- M D M H U P --
- Sends escape sequence to modem, then sends its hangup command. Returns:
- 0: If modem type is 0 (direct serial connection),
- or if modem type is < 0 (network connection),
- or if no action taken because DIAL MODEM-HANGUP is OFF)
- or because no hangup string for current modem type,
- or C-Kermit is in remote mode,
- or if action taken but there was no positive response from modem;
- 1: Success: modem is in command state and acknowledged the hangup command;
- -1: On modem command error.
- */
- int
- mdmhup() {
- #ifdef MDMHUP
- int m, x = 0;
- int xparity;
- int savcarr;
- extern int ttcarr;
- char *s, *p, c;
- MDMINF * mp = NULL;
- debug(F101,"mdmhup dialmhu","",dialmhu); /* MODEM-HANGUP METHOD */
- debug(F101,"mdmhup local","",local);
- if (dialmhu == 0 || local == 0) /* If DIAL MODEM-HANGUP is OFF, */
- return(0); /* or not in local mode, fail. */
- debug(F101,"mdmhup dialsta","",dialsta);
- debug(F101,"mdmhup mdmset","",mdmset);
- if (dialsta != DIA_OK && !mdmset) /* It's not a dialed connection */
- return(0);
- #ifdef CK_TAPI
- if (tttapi && !tapipass) /* Don't hangup if using TAPI */
- return(0);
- #endif /* CK_TAPI */
- #ifdef COMMENT
- /* No, we still need this for modems that ignore DTR */
- if (mymdmtyp == n_GENERIC && !network)
- return(0);
- #endif /* COMMENT */
- debug(F101,"mdmhup dialesc","",dialesc);
- if (dialesc < 0)
- return(0); /* No modem escape-character, fail. */
- savcarr = ttcarr;
- ttcarr = CAR_OFF;
- x = ttchk();
- ttcarr = savcarr;
- debug(F101,"mdmhup ttchk","",x);
- if (x < 0) /* There appears to be no connection */
- return(0);
- x = 0;
- #ifdef OS2
- /*
- In OS/2, if CARRIER is OFF, and there is indeed no carrier signal, any
- attempt to do i/o at this point can hang the program. This might be true
- for other operating systems too.
- */
- if (!network /* Not a network connection */
- #ifdef TN_COMPORT
- || istncomport()
- #endif /* TN_COMPORT */
- ) {
- m = ttgmdm(); /* Get modem signals */
- if ((m > -1) && (m & BM_DCD == 0)) /* Check for carrier */
- return(0); /* No carrier, skip the rest */
- }
- #endif /* OS2 */
- debug(F111,"mdmhup network",ttname,network);
- debug(F101,"mdmhup mymdmtyp","",mymdmtyp);
- debug(F101,"mdmhup mdmtyp","",mdmtyp);
- /* In case of HANGUP before DIAL */
- if (network && mdmtyp < 1) /* SET HOST but no subsequent */
- return(0); /* SET MODEM TYPE... */
- if (mymdmtyp == 0 && mdmtyp > 0)
- mymdmtyp = mdmtyp;
- if (mymdmtyp < 1) /* Not using a modem */
- return(0);
- if (mymdmtyp > 0) /* An actual modem... */
- mp = modemp[mymdmtyp];
- if (!mp) { /* Get pointer to its MDMINF struct */
- debug(F100,"mdmhup no MDMINF","",0);
- return(0);
- }
- mdmcapas = dialcapas ? dialcapas : mp->capas;
- xx_ok = mp->ok_fn; /* Pointer to response reader */
- s = dialhcmd ? dialhcmd : mp->hup_str; /* Get hangup command */
- if (!s) s = "";
- debug(F110,"mdmhup hup_str",s,0);
- if (!*s) return(0); /* If none, fail. */
- if (ttpkt(speed,FLO_DIAL,parity) < 0) /* Condition line for dialing */
- return(-1);
- xparity = parity; /* Set PARITY to NONE temporarily */
- parity = 0;
- /* In case they gave a SET MODEM ESCAPE command recently... */
- if (dialesc < 0 || dialesc > 127)
- c = NUL;
- else
- c = (char) (dialesc ? dialesc : mp->esc_char);
- if (mdmcapas & CKD_AT) { /* Hayes compatible */
- escbuf[0] = c;
- escbuf[1] = c;
- escbuf[2] = c;
- escbuf[3] = NUL;
- } else { /* Other */
- escbuf[0] = c;
- escbuf[1] = NUL;
- }
- debug(F110,"mdmhup escbuf",escbuf,0);
- if (escbuf[0]) { /* Have escape sequence? */
- debug(F101,"mdmhup esc_time",0,mp->esc_time);
- if (mp->esc_time) /* If we have a guard time */
- msleep(mp->esc_time); /* Pause for guard time */
- debug(F100,"mdmhup pause 1 OK","",0);
- #ifdef NETCONN /* Send modem's escape sequence */
- if (network) { /* Must catch errors here. */
- if (ttol((CHAR *)escbuf,(int)strlen((char *)escbuf)) < 0) {
- parity = xparity;
- return(-1);
- }
- debug(F110,"mdmhup ttslow net ok",escbuf,0);
- } else {
- #endif /* NETCONN */
- ttslow((char *)escbuf,wr); /* Send escape sequence */
- debug(F110,"mdmhup ttslow ok",escbuf,0);
- #ifdef NETCONN
- }
- #endif /* NETCONN */
- if (mp->esc_time) /* Pause for guard time again */
- msleep(mp->esc_time);
- else
- msleep(500); /* Wait half a sec for echoes. */
- debug(F100,"mdmhup pause 1 OK","",0);
- #ifdef COMMENT
- ttflui(); /* Flush response or echo, if any */
- debug(F100,"mdmhup ttflui OK","",0);
- #endif /* COMMENT */
- }
- ttslow(s,wr); /* Now Send hangup string */
- debug(F110,"mdmhup ttslow ok",s,0);
- /*
- This is not exactly right, but it works.
- If we are online:
- the modem says OK when it gets the escape sequence,
- and it says NO CARRIER when it gets the hangup command.
- If we are offline:
- the modem does NOT say OK (or anything else) when it gets the esc sequence,
- but it DOES say OK (and not NO CARRIER) when it gets the hangup command.
- So the following function should read the OK in both cases.
- Of course, this is somewhat Hayes-specific...
- */
- if (xx_ok) { /* Look for OK response */
- debug(F100,"mdmhup calling response function","",0);
- x = (*xx_ok)(3,1); /* Give it 3 seconds, be strict. */
- debug(F101,"mdmhup hangup response","",x);
- msleep(500); /* Wait half a sec */
- ttflui(); /* Get rid of NO CARRIER, if any */
- } else { /* No OK function, */
- x = 1; /* so assume it worked */
- debug(F101,"mdmhup no ok_fn","",x);
- }
- parity = xparity; /* Restore prevailing parity */
- return(x); /* Return OK function's return code. */
- #else /* MDMHUP not defined. */
- debug(F100,"mdmhup MDMHUP not defined","",0);
- return(0); /* Always fail. */
- #endif /* MDMHUP */
- }
- #endif /* NOICP */
- #else /* NODIAL */
- int mdmtyp = 0; /* Default modem type */
- int /* To allow NODIAL versions to */
- mdmhup() { /* call mdmhup(), so calls to */
- return(0); /* mdmhup() need not be within */
- } /* #ifndef NODIAL conditionals */
- #endif /* NODIAL */
- #else
- int mdmtyp = 0; /* Default modem type */
- #endif /* NOLOCAL */
|