FreeCalypso > hg > tcs211-l1-reconst
comparison g23m/condat/ms/src/aci/psa_ccp.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : PSA_CCP | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This module defines the processing functions for the | |
18 | primitives send to the protocol stack adapter by call | |
19 | control. | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #ifndef PSA_CCP_C | |
24 #define PSA_CCP_C | |
25 #endif | |
26 | |
27 #include "aci_all.h" | |
28 | |
29 /*==== INCLUDES ===================================================*/ | |
30 #include "ccdapi.h" | |
31 | |
32 #include "aci_cmh.h" | |
33 #include "ati_cmd.h" | |
34 #include "aci_cmd.h" | |
35 #include "aci_mem.h" | |
36 #include "aci_lst.h" | |
37 | |
38 #ifdef FAX_AND_DATA | |
39 #include "aci_fd.h" | |
40 #endif /* of #ifdef FAX_AND_DATA */ | |
41 | |
42 #include "aci.h" | |
43 #include "psa.h" | |
44 #include "psa_cc.h" | |
45 #include "psa_ss.h" | |
46 #include "psa_mmi.h" | |
47 #include "psa_mm.h" | |
48 #include "cmh.h" | |
49 #include "cmh_cc.h" | |
50 | |
51 #ifdef SIM_TOOLKIT | |
52 #include "psa_sat.h" | |
53 #include "cmh_sat.h" | |
54 #endif /* of #ifdef SIM_TOOLKIT */ | |
55 | |
56 #include "aoc.h" | |
57 #include "psa_sim.h" | |
58 | |
59 #if defined (FF_WAP) || defined (FF_SAT_E) | |
60 #include "wap_aci.h" | |
61 #endif /* of FF_WAP */ | |
62 | |
63 #include "l4_tim.h" | |
64 | |
65 /*==== CONSTANTS ==================================================*/ | |
66 | |
67 | |
68 /*==== TYPES ======================================================*/ | |
69 | |
70 | |
71 /*==== EXPORT =====================================================*/ | |
72 | |
73 #ifdef FF_EM_MODE | |
74 EXTERN USHORT em_relcs; | |
75 #endif /* FF_EM_MODE | |
76 | |
77 /*==== VARIABLES ==================================================*/ | |
78 | |
79 EXTERN T_PCEER causeMod; | |
80 EXTERN SHORT causeCeer; | |
81 | |
82 /*==== FUNCTIONS ==================================================*/ | |
83 | |
84 | |
85 /* | |
86 +-------------------------------------------------------------------+ | |
87 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
88 | ROUTINE : psa_mncc_setup_ind | | |
89 +-------------------------------------------------------------------+ | |
90 | |
91 PURPOSE : processes the MNCC_SETUP_IND primitive send by CC. | |
92 this indicates an incoming call. | |
93 | |
94 */ | |
95 // CC test 0319 | |
96 extern void CongiureGPIO_Internal(int GpioPin); | |
97 extern void HighGPIO(int GpioPin); | |
98 extern void LowGPIO(int GpioPin); | |
99 // end | |
100 | |
101 GLOBAL const void psa_mncc_setup_ind | |
102 ( T_MNCC_SETUP_IND *mncc_setup_ind ) | |
103 { | |
104 SHORT cId; /* holds call id */ | |
105 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
106 int i; | |
107 | |
108 TRACE_FUNCTION ("psa_mncc_setup_ind()"); | |
109 | |
110 causeMod = P_CEER_mod; /* Clear module which was set for ceer */ | |
111 causeCeer = CEER_NotPresent; /* Clear extended error cause */ | |
112 | |
113 // CC test 0319 | |
114 CongiureGPIO_Internal(1); | |
115 // LowGPIO(1); | |
116 // end | |
117 | |
118 /* stop redialling timer if necessary */ | |
119 if (rdlPrm.rdlcId NEQ NO_ENTRY) | |
120 { | |
121 TIMERSTOP(ACI_REPEAT_HND); | |
122 | |
123 #ifdef SIM_TOOLKIT | |
124 if( ( ccShrdPrm.ctb[rdlPrm.rdlcId]->SATinv & SAT_REDIAL ) ) | |
125 { /* This is the call invoked by SAT */ | |
126 T_ACI_SAT_TERM_RESP resp_data; | |
127 | |
128 psaSAT_InitTrmResp( &resp_data ); | |
129 psaSAT_SendTrmResp( RSLT_USR_CLR_DWN, &resp_data ); | |
130 } | |
131 #endif /* SIM_TOOLKIT */ | |
132 | |
133 psaCC_FreeCtbNtry (rdlPrm.rdlcId); | |
134 for(i = 0; i < CMD_SRC_MAX; i++) | |
135 { | |
136 R_AT(RAT_RDL, i)(REDIAL_STOP); | |
137 } | |
138 /* reset some redial parameter */ | |
139 rdlPrm.rdlcId = NO_ENTRY; | |
140 } | |
141 | |
142 /* | |
143 *------------------------------------------------------------------- | |
144 * check for new entry in call table | |
145 *------------------------------------------------------------------- | |
146 */ | |
147 cId = psaCC_ctbNewEntry(); | |
148 | |
149 if( cId < 0 ) | |
150 { | |
151 /* | |
152 * disconnect call, due to full call table. | |
153 */ | |
154 { | |
155 UBYTE ti = mncc_setup_ind -> ti; | |
156 PREUSE (mncc_setup_ind, mncc_disconnect_req, MNCC_DISCONNECT_REQ); | |
157 mncc_disconnect_req -> ti = ti; | |
158 mncc_disconnect_req -> cause = MNCC_CAUSE_USER_BUSY; | |
159 mncc_disconnect_req -> fac_inf.l_fac = 0; | |
160 mncc_disconnect_req -> ss_version = SS_VER_NOT_PRES; | |
161 PSENDX (CC, mncc_disconnect_req); | |
162 } | |
163 | |
164 TRACE_EVENT ("MTC rejected due to full call table"); | |
165 | |
166 return; | |
167 } | |
168 | |
169 /* | |
170 *------------------------------------------------------------------- | |
171 * update shared parameter and notify ACI | |
172 *------------------------------------------------------------------- | |
173 */ | |
174 pCtbNtry = ccShrdPrm.ctb[cId]; | |
175 pCtbNtry -> curCs = MNCC_CAUSE_NO_MS_CAUSE; | |
176 | |
177 pCtbNtry -> ti = mncc_setup_ind -> ti; | |
178 pCtbNtry -> rptInd = mncc_setup_ind -> ri; | |
179 pCtbNtry -> sigInf = mncc_setup_ind -> sig; | |
180 pCtbNtry -> clgPty = mncc_setup_ind -> calling_party; | |
181 pCtbNtry -> clgPtySub = mncc_setup_ind -> calling_party_sub; | |
182 | |
183 /* | |
184 * Assign called party | |
185 */ | |
186 pCtbNtry -> cldPty.ton = mncc_setup_ind -> called_party.ton; | |
187 pCtbNtry -> cldPty.npi = mncc_setup_ind -> called_party.npi; | |
188 pCtbNtry -> cldPty.c_called_num = | |
189 mncc_setup_ind -> called_party.c_called_num; | |
190 if (pCtbNtry -> cldPty.called_num NEQ NULL) | |
191 { | |
192 ACI_MFREE (pCtbNtry -> cldPty.called_num); | |
193 pCtbNtry -> cldPty.called_num = NULL; | |
194 } | |
195 if (pCtbNtry -> cldPty.c_called_num NEQ 0) | |
196 { | |
197 ACI_MALLOC (pCtbNtry -> cldPty.called_num, | |
198 pCtbNtry -> cldPty.c_called_num); | |
199 memcpy (pCtbNtry -> cldPty.called_num, | |
200 mncc_setup_ind -> called_party.called_num, | |
201 mncc_setup_ind -> called_party.c_called_num); | |
202 } | |
203 | |
204 /* | |
205 * Assign called party subaddress | |
206 */ | |
207 pCtbNtry -> cldPtySub = mncc_setup_ind -> called_party_sub; | |
208 | |
209 /* | |
210 * Assign redirecting party | |
211 */ | |
212 pCtbNtry -> rdrPty.ton = mncc_setup_ind -> redirecting_party.ton; | |
213 pCtbNtry -> rdrPty.npi = mncc_setup_ind -> redirecting_party.npi; | |
214 pCtbNtry -> rdrPty.present = mncc_setup_ind -> redirecting_party.present; | |
215 pCtbNtry -> rdrPty.screen = mncc_setup_ind -> redirecting_party.screen; | |
216 pCtbNtry -> rdrPty.c_redir_num = | |
217 mncc_setup_ind -> redirecting_party.c_redir_num; | |
218 if (pCtbNtry -> rdrPty.redir_num NEQ NULL) | |
219 { | |
220 ACI_MFREE (pCtbNtry -> rdrPty.redir_num); | |
221 pCtbNtry -> rdrPty.redir_num = NULL; | |
222 } | |
223 if (pCtbNtry -> rdrPty.c_redir_num NEQ 0) | |
224 { | |
225 ACI_MALLOC (pCtbNtry -> rdrPty.redir_num, | |
226 pCtbNtry -> rdrPty.c_redir_num); | |
227 memcpy (pCtbNtry -> rdrPty.redir_num, | |
228 mncc_setup_ind -> redirecting_party.redir_num, | |
229 mncc_setup_ind -> redirecting_party.c_redir_num); | |
230 } | |
231 | |
232 /* | |
233 * Assign redirecting party subaddress | |
234 */ | |
235 pCtbNtry -> rdrPtySub.tos = | |
236 mncc_setup_ind -> redirecting_party_sub.tos; | |
237 pCtbNtry -> rdrPtySub.odd_even = | |
238 mncc_setup_ind -> redirecting_party_sub.odd_even; | |
239 pCtbNtry -> rdrPtySub.c_subaddr = | |
240 mncc_setup_ind -> redirecting_party_sub.c_subaddr; | |
241 if (pCtbNtry -> rdrPtySub.subaddr NEQ NULL) | |
242 { | |
243 ACI_MFREE (pCtbNtry -> rdrPtySub.subaddr); | |
244 pCtbNtry -> rdrPtySub.subaddr = NULL; | |
245 } | |
246 if (pCtbNtry -> rdrPtySub.c_subaddr NEQ 0) | |
247 { | |
248 ACI_MALLOC (pCtbNtry -> rdrPtySub.subaddr, | |
249 pCtbNtry -> rdrPtySub.c_subaddr); | |
250 memcpy (pCtbNtry -> rdrPtySub.subaddr, | |
251 mncc_setup_ind -> redirecting_party_sub.subaddr, | |
252 mncc_setup_ind -> redirecting_party_sub.c_subaddr); | |
253 } | |
254 | |
255 /* | |
256 * Assign bearer caps | |
257 */ | |
258 memcpy( &(pCtbNtry->BC[0]),&(mncc_setup_ind->bcpara), | |
259 sizeof( T_bcpara) ); | |
260 memcpy( &(pCtbNtry->BC[1]),&(mncc_setup_ind->bcpara2), | |
261 sizeof( T_bcpara) ); | |
262 | |
263 psaCC_phbSrchNum( cId, CT_MTC ); | |
264 | |
265 pCtbNtry -> calStat = CS_ACT_REQ; | |
266 pCtbNtry -> calType = CT_MTC; | |
267 | |
268 pCtbNtry -> prio = PRIO_NORM_CALL; | |
269 pCtbNtry -> curBC = 0; | |
270 | |
271 psaCC_send_satevent( EVENT_MT_CALL, cId, FAR_END, FALSE ); | |
272 | |
273 /* | |
274 *------------------------------------------------------------------- | |
275 * indicate alerting | |
276 *------------------------------------------------------------------- | |
277 */ | |
278 | |
279 /* replace invalid/unknown sigInf by SIG_NOT_PRES */ | |
280 switch (pCtbNtry -> sigInf) | |
281 { | |
282 case SIG_DIAL_TONE_ON: | |
283 case SIG_RING_BACK_TONE_ON: | |
284 case SIG_INT_TONE_ON: | |
285 case SIG_NET_CONG_TONE_ON: | |
286 case SIG_BUSY_TONE_ON: | |
287 case SIG_CONF_TONE_ON: | |
288 case SIG_ANS_TONE_ON: | |
289 case SIG_CALL_WAIT_TONE_ON: | |
290 case SIG_OFF_HOOK_WARN_TONE_ON: | |
291 case SIG_TONES_OFF: | |
292 case SIG_ALERT_OFF: | |
293 case SIG_NOT_PRES: | |
294 break; /* leave as it is */ | |
295 default: /* replace unknown value by something well known */ | |
296 pCtbNtry -> sigInf = SIG_NOT_PRES; | |
297 } | |
298 | |
299 if( pCtbNtry -> sigInf NEQ SIG_NOT_PRES OR | |
300 ccShrdPrm.TCHasg EQ TRUE ) | |
301 { | |
302 { | |
303 /* indicate alerting to network */ | |
304 UBYTE ti = mncc_setup_ind -> ti; | |
305 PREUSE (mncc_setup_ind, mncc_alert_req, MNCC_ALERT_REQ); | |
306 mncc_alert_req -> ti = ti; | |
307 PSENDX (CC, mncc_alert_req); | |
308 } | |
309 | |
310 cmhCC_IncomingCall (cId); /* indicate an incoming call */ | |
311 return; | |
312 } | |
313 else | |
314 { | |
315 pCtbNtry -> alrtStat = AS_PND; | |
316 } | |
317 | |
318 /* | |
319 * check for progress descriptions | |
320 */ | |
321 psaCC_chkPrgDesc ( cId, mncc_setup_ind -> progress_desc, MT_SETUP ); | |
322 | |
323 /* | |
324 * start call time measurements | |
325 */ | |
326 aoc_info (cId, AOC_START_TIME); | |
327 /* | |
328 *------------------------------------------------------------------- | |
329 * free the primitive buffer | |
330 *------------------------------------------------------------------- | |
331 */ | |
332 PFREE (mncc_setup_ind); | |
333 } | |
334 | |
335 /* | |
336 +-------------------------------------------------------------------+ | |
337 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
338 | ROUTINE : psa_mncc_setup_cnf | | |
339 +-------------------------------------------------------------------+ | |
340 | |
341 PURPOSE : processes the MNCC_SETUP_CNF primitive send by CC. | |
342 this terminates the call establishment request. | |
343 | |
344 */ | |
345 | |
346 GLOBAL const void psa_mncc_setup_cnf | |
347 ( T_MNCC_SETUP_CNF *mncc_setup_cnf ) | |
348 { | |
349 SHORT cId; /* holds call id */ | |
350 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
351 int i; | |
352 BOOL flag_redial = FALSE; | |
353 | |
354 TRACE_FUNCTION ("psa_mncc_setup_cnf()"); | |
355 | |
356 /* | |
357 *------------------------------------------------------------------- | |
358 * find call in call table | |
359 *------------------------------------------------------------------- | |
360 */ | |
361 cId = psaCC_ctbFindTi( mncc_setup_cnf -> ti ); | |
362 | |
363 if( cId < 0 ) | |
364 { | |
365 /* | |
366 * ignore primitive, due to not found transaction identifier. | |
367 */ | |
368 TRACE_EVENT ("primitive rejected due to unused ti"); | |
369 PFREE(mncc_setup_cnf); | |
370 return; | |
371 } | |
372 | |
373 /* | |
374 *------------------------------------------------------------------- | |
375 * update shared parameter and notify ACI | |
376 *------------------------------------------------------------------- | |
377 */ | |
378 pCtbNtry = ccShrdPrm.ctb[cId]; | |
379 pCtbNtry -> curCs = mncc_setup_cnf -> cause; | |
380 pCtbNtry -> rslt = mncc_setup_cnf -> cause; | |
381 | |
382 | |
383 switch( mncc_setup_cnf -> cause ) | |
384 { | |
385 case( MNCC_CAUSE_SUCCESS ): /* successful establishment, call connected */ | |
386 | |
387 /* | |
388 * MNCC_SETUP_CNF is received in call state other than CS_ACT_REQ | |
389 * so reject the primitive. | |
390 */ | |
391 if( pCtbNtry -> calStat NEQ CS_ACT_REQ) | |
392 { | |
393 TRACE_EVENT ("MNCC_SETUP_CNF is rejected as it is received in call state other than CS_ACT_REQ"); | |
394 break; | |
395 } | |
396 pCtbNtry -> clgPty.ton = mncc_setup_cnf -> connected_number.ton; | |
397 pCtbNtry -> clgPty.npi = mncc_setup_cnf -> connected_number.npi; | |
398 pCtbNtry -> clgPty.present = mncc_setup_cnf -> connected_number.present; | |
399 pCtbNtry -> clgPty.screen = mncc_setup_cnf -> connected_number.screen; | |
400 pCtbNtry -> clgPty.c_num = mncc_setup_cnf -> connected_number.c_num; | |
401 | |
402 memcpy( pCtbNtry -> clgPty.num, | |
403 mncc_setup_cnf -> connected_number.num, MAX_CC_CALLING_NUMBER ); | |
404 | |
405 pCtbNtry -> clgPtySub.tos = mncc_setup_cnf -> connected_number_sub.tos; | |
406 pCtbNtry -> clgPtySub.odd_even = mncc_setup_cnf -> connected_number_sub.odd_even; | |
407 pCtbNtry -> clgPtySub.c_subaddr = mncc_setup_cnf -> connected_number_sub.c_subaddr; | |
408 | |
409 memcpy( pCtbNtry -> clgPtySub.subaddr, | |
410 mncc_setup_cnf -> connected_number_sub.subaddr, SUB_LENGTH ); | |
411 | |
412 pCtbNtry -> inBndTns = FALSE; | |
413 pCtbNtry -> calStat = CS_ACT; | |
414 | |
415 /* check for progress descriptions */ | |
416 psaCC_chkPrgDesc ( cId, mncc_setup_cnf -> progress_desc, MT_CONN ); | |
417 | |
418 | |
419 if(pCtbNtry->calType EQ CT_MOC_RDL) | |
420 { | |
421 pCtbNtry->calType = CT_MOC; | |
422 flag_redial = TRUE; | |
423 } | |
424 /* if redialling procedure was successful we finish redialling */ | |
425 if((rdlPrm.rdlMod EQ AUTOM_REPEAT_ON) AND flag_redial) | |
426 { | |
427 for(i = 0; i < CMD_SRC_MAX; i++) | |
428 { | |
429 R_AT(RAT_RDL, i)(CALL_ATTEMPT_SUCCESSFUL); | |
430 } | |
431 pCtbNtry->rdlCnt = 0; | |
432 rdlPrm.rdlcId = NO_ENTRY; | |
433 pCtbNtry->rdlTimIndex = RDL_TIM_INDEX_NOT_PRESENT; | |
434 flag_redial = FALSE; | |
435 } | |
436 | |
437 /* Inform that a call goes to active state */ | |
438 psaCC_chngCalTypCnt( cId, +1 ); | |
439 | |
440 cmhCC_CallConnected( cId ); | |
441 | |
442 psaCC_send_satevent( EVENT_CALL_CONN, cId, FAR_END, FALSE ); | |
443 | |
444 aoc_info (cId,AOC_CALL_CONNECTED); | |
445 | |
446 /* check for TTY service */ | |
447 cmhCC_TTY_Control ( cId, TTY_START ); | |
448 | |
449 /* check for DTMF tones to send automatically */ | |
450 psaCC_DTMFSent ( cId ); | |
451 | |
452 #if defined (FF_WAP) || defined (FF_SAT_E) | |
453 /* WAP STACK CALL is activ */ | |
454 if (Wap_Call) | |
455 ccShrdPrm.wapStat = CC_WAP_STACK_UP; | |
456 #endif | |
457 | |
458 break; | |
459 | |
460 default: /* unexpected result, assumed call disconnected */ | |
461 { | |
462 TRACE_EVENT_P1("[ERR] UNEXP CAUSE IN SETUP CNF=%4x", mncc_setup_cnf -> cause); | |
463 } | |
464 /*FALLTHROUGH*/ /*lint -fallthrough*/ | |
465 | |
466 /* unsuccessful establishment, call disconnected */ | |
467 case( MNCC_CAUSE_MS_TIMER ): | |
468 | |
469 pCtbNtry -> nrmCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
470 pCtbNtry -> rejCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
471 #ifdef FF_EM_MODE | |
472 em_relcs = MNCC_CAUSE_MS_TIMER; | |
473 #endif /* FF_EM_MODE */ | |
474 ccShrdPrm.cIdFail = cId; | |
475 | |
476 /* | |
477 * At this point the call has not yet gone completely always. | |
478 * Call Control may not be in state U0, but in state U11, having | |
479 * sent a DISCONNECT to the network, expecting the RELEASE | |
480 * from the network or expiry of T308 in CC. | |
481 * Implementation works, but it is not very nice here, releasing | |
482 * the ti and decrementing the call count too early. | |
483 */ | |
484 pCtbNtry -> calStat = CS_IDL; | |
485 | |
486 psaCC_chngCalTypCnt( cId, -1 ); | |
487 psaCC_retMOCTi( pCtbNtry -> ti ); | |
488 cmhCC_CallDisconnected (cId); | |
489 psaCC_FreeCtbNtry (cId); | |
490 break; | |
491 } | |
492 /* | |
493 *------------------------------------------------------------------- | |
494 * free the primitive buffer | |
495 *------------------------------------------------------------------- | |
496 */ | |
497 PFREE (mncc_setup_cnf); | |
498 | |
499 } | |
500 | |
501 /* | |
502 +-------------------------------------------------------------------+ | |
503 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
504 | ROUTINE : psa_mncc_setup_compl_ind| | |
505 +-------------------------------------------------------------------+ | |
506 | |
507 PURPOSE : processes the MNCC_SETUP_COMPL_IND primitive send by CC. | |
508 this terminates the call establishment of an incoming call. | |
509 | |
510 */ | |
511 | |
512 GLOBAL const void psa_mncc_setup_compl_ind | |
513 ( T_MNCC_SETUP_COMPL_IND *mncc_setup_compl_ind ) | |
514 { | |
515 SHORT cId; /* holds call id */ | |
516 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
517 | |
518 TRACE_FUNCTION ("psa_mncc_setup_compl_ind()"); | |
519 | |
520 /* | |
521 *------------------------------------------------------------------- | |
522 * find call in call table | |
523 *------------------------------------------------------------------- | |
524 */ | |
525 cId = psaCC_ctbFindTi( mncc_setup_compl_ind -> ti ); | |
526 | |
527 if( cId < 0 ) | |
528 { | |
529 /* | |
530 * ignore primitive, due to not found transaction identifier. | |
531 */ | |
532 TRACE_EVENT ("primitive rejected due to unused ti"); | |
533 PFREE(mncc_setup_compl_ind); | |
534 return; | |
535 } | |
536 | |
537 /* | |
538 *------------------------------------------------------------------- | |
539 * update shared parameter and notify ACI | |
540 *------------------------------------------------------------------- | |
541 */ | |
542 pCtbNtry = ccShrdPrm.ctb[cId]; | |
543 | |
544 pCtbNtry -> rslt = mncc_setup_compl_ind -> cause; | |
545 pCtbNtry -> curCs = mncc_setup_compl_ind -> cause; | |
546 | |
547 switch( mncc_setup_compl_ind -> cause ) | |
548 { | |
549 case( MNCC_CAUSE_SUCCESS ): /* successful establishment, call connected */ | |
550 | |
551 pCtbNtry -> inBndTns = FALSE; | |
552 pCtbNtry -> calStat = CS_ACT; | |
553 | |
554 psaCC_setSpeechMode (); | |
555 | |
556 /* check for TTY service */ | |
557 cmhCC_TTY_Control ( cId, TTY_START ); | |
558 | |
559 /* | |
560 * Inform that a call goes to active state | |
561 */ | |
562 psaCC_chngCalTypCnt( cId, +1 ); | |
563 | |
564 cmhCC_CallConnected( cId ); | |
565 | |
566 aoc_info (cId, AOC_CALL_CONNECTED); | |
567 break; | |
568 | |
569 default: /* unexpected result, assumed call disconnected */ | |
570 { | |
571 TRACE_EVENT_P1("[ERR] UNEXP CAUSE IN SETUP CMPL IND=%4x", mncc_setup_compl_ind -> cause); | |
572 } | |
573 /*FALLTHROUGH*/ /*lint -fallthrough*/ | |
574 | |
575 /* unsuccessful establishment, call disconnected */ | |
576 case( MNCC_CAUSE_MS_TIMER ): | |
577 | |
578 pCtbNtry -> nrmCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
579 pCtbNtry -> rejCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
580 #ifdef FF_EM_MODE | |
581 em_relcs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
582 #endif /* FF_EM_MODE */ | |
583 ccShrdPrm.cIdFail = cId; | |
584 | |
585 /* | |
586 * What happens below is somewhat questionable. | |
587 * ACI sets the call to CS_IDL and free the transaction identifier. | |
588 * What happened is that on CC level, in state U8 CONNECT REQUEST the | |
589 * CONNECT message sent by CC has not been answered by the network by a | |
590 * CONNECT ACNOWLEDGE message. | |
591 * In this situation CC sends a DISCONNECT to the network and enters | |
592 * state U11 DISCONNECT REQUEST. This means, the call state in CC is | |
593 * still different from U0 NULL. | |
594 * However, problems in the field are not expected here. | |
595 */ | |
596 pCtbNtry -> calStat = CS_IDL; | |
597 | |
598 psaCC_chngCalTypCnt( cId, -1 ); | |
599 psaCC_retMOCTi( pCtbNtry -> ti ); | |
600 | |
601 cmhCC_CallDisconnected (cId); | |
602 cmhCC_CallReleased (cId); | |
603 | |
604 break; | |
605 } | |
606 | |
607 /* | |
608 *------------------------------------------------------------------- | |
609 * free the primitive buffer | |
610 *------------------------------------------------------------------- | |
611 */ | |
612 PFREE (mncc_setup_compl_ind); | |
613 | |
614 } | |
615 | |
616 /* | |
617 +-------------------------------------------------------------------+ | |
618 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
619 | ROUTINE : psa_mncc_reject_ind | | |
620 +-------------------------------------------------------------------+ | |
621 | |
622 PURPOSE : processes the MNCC_REJECT_IND primitive send by CC. | |
623 this indicates a cause for rejecting a call establishment. | |
624 | |
625 */ | |
626 | |
627 GLOBAL const void psa_mncc_reject_ind | |
628 ( T_MNCC_REJECT_IND *mncc_reject_ind ) | |
629 { | |
630 SHORT cId; /* holds call id */ | |
631 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
632 | |
633 TRACE_FUNCTION ("psa_mncc_reject_ind()"); | |
634 | |
635 /* | |
636 *------------------------------------------------------------------- | |
637 * find call in call table | |
638 *------------------------------------------------------------------- | |
639 */ | |
640 cId = psaCC_ctbFindTi( mncc_reject_ind -> ti ); | |
641 | |
642 if( cId < 0 ) | |
643 { | |
644 /* | |
645 * ignore primitive, due to not found transaction identifier. | |
646 */ | |
647 TRACE_EVENT ("primitive rejected due to unused ti"); | |
648 PFREE(mncc_reject_ind); | |
649 return; | |
650 } | |
651 psaCC_StopDTMF (cId); /* HM 27.07.00*/ | |
652 | |
653 /* | |
654 *------------------------------------------------------------------- | |
655 * update shared parameter and notify ACI | |
656 *------------------------------------------------------------------- | |
657 */ | |
658 pCtbNtry = ccShrdPrm.ctb[cId]; | |
659 pCtbNtry -> curCs = mncc_reject_ind -> cause; | |
660 | |
661 pCtbNtry -> rslt = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
662 pCtbNtry -> nrmCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
663 pCtbNtry -> rejCs = mncc_reject_ind -> cause; | |
664 /* In this case, the cause values are internal and not sent by network */ | |
665 pCtbNtry -> numRawCauseBytes = 0; | |
666 | |
667 #ifdef FF_EM_MODE | |
668 em_relcs = mncc_reject_ind -> cause; | |
669 #endif /* FF_EM_MODE */ | |
670 | |
671 if( GET_CAUSE_VALUE(pCtbNtry -> rejCs) NEQ NOT_PRESENT_8BIT ) ccShrdPrm.cIdFail = cId; | |
672 | |
673 pCtbNtry -> calStat = CS_IDL; | |
674 | |
675 psaCC_chngCalTypCnt( cId, -1 ); | |
676 psaCC_retMOCTi( pCtbNtry -> ti ); | |
677 | |
678 /* monitoring for SAT radio-link failure */ | |
679 psaCC_send_satevent( EVENT_CALL_DISC, cId, NEAR_END, TRUE ); | |
680 | |
681 /* check conditions for redialling */ | |
682 cmhCC_redialCheck(cId); | |
683 | |
684 #ifdef SIM_TOOLKIT | |
685 if( pCtbNtry->SATinv ) | |
686 { | |
687 cmhSAT_NtwErr( ADD_NO_CAUSE ); | |
688 pCtbNtry->SATinv = FALSE; | |
689 } | |
690 #endif | |
691 /* cmhCC_CallDisconnected(cId);*/ | |
692 cmhCC_CPIrejectMsg(cId); | |
693 cmhCC_CallReleased(cId); | |
694 | |
695 /* free the primitive buffer */ | |
696 PFREE (mncc_reject_ind); | |
697 | |
698 } | |
699 | |
700 /* | |
701 +-------------------------------------------------------------------+ | |
702 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
703 | ROUTINE : psa_mncc_release_ind | | |
704 +-------------------------------------------------------------------+ | |
705 | |
706 PURPOSE : processes the MNCC_RELEASE_IND primitive send by CC. | |
707 this indicates the release of a call. | |
708 | |
709 */ | |
710 | |
711 GLOBAL const void psa_mncc_release_ind | |
712 ( T_MNCC_RELEASE_IND *mncc_release_ind ) | |
713 { | |
714 SHORT cId; /* holds call id */ | |
715 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
716 | |
717 TRACE_FUNCTION ("psa_mncc_release_ind()"); | |
718 | |
719 /* | |
720 *------------------------------------------------------------------- | |
721 * find call in call table | |
722 *------------------------------------------------------------------- | |
723 */ | |
724 cId = psaCC_ctbFindTi( mncc_release_ind -> ti ); | |
725 | |
726 if( cId < 0 ) | |
727 { | |
728 psaCC_retMOCTi( mncc_release_ind -> ti ); | |
729 | |
730 /* | |
731 * ignore primitive, due to not found transaction identifier. | |
732 */ | |
733 TRACE_EVENT ("primitive rejected due to unused ti"); | |
734 PFREE(mncc_release_ind); | |
735 return; | |
736 } | |
737 psaCC_StopDTMF ( cId ); /* HM 27.07.00 */ | |
738 | |
739 /* | |
740 *------------------------------------------------------------------- | |
741 * update shared parameter and notify ACI | |
742 *------------------------------------------------------------------- | |
743 */ | |
744 pCtbNtry = ccShrdPrm.ctb[cId]; | |
745 | |
746 pCtbNtry -> calStat = CS_DSC_REQ; /* Leave active state */ | |
747 pCtbNtry -> curCs = mncc_release_ind -> cause; | |
748 pCtbNtry -> numRawCauseBytes = mncc_release_ind -> c_raw_cause; | |
749 pCtbNtry -> rawCauseBytes = mncc_release_ind -> raw_cause; | |
750 | |
751 psaCC_setSpeechMode (); | |
752 | |
753 /* check for TTY service */ | |
754 /*cmhCC_TTY_Control ( cId );*/ | |
755 | |
756 if (pCtbNtry -> nrmCs EQ MNCC_CAUSE_NO_MS_CAUSE) /* no Disconnect Cause available...*/ | |
757 { | |
758 pCtbNtry -> nrmCs= mncc_release_ind -> cause; /* Check ### */ | |
759 ccShrdPrm.cIdFail = cId; /* Check ### */ | |
760 #ifdef FF_EM_MODE | |
761 em_relcs = mncc_release_ind -> cause; /* Check ### */ | |
762 #endif /* FF_EM_MODE */ | |
763 } | |
764 | |
765 pCtbNtry -> rejCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
766 pCtbNtry -> rslt = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
767 | |
768 psaCC_chngCalTypCnt( cId, -1 ); | |
769 psaCC_retMOCTi( pCtbNtry -> ti ); | |
770 | |
771 psaCC_send_satevent( EVENT_CALL_DISC, cId, FAR_END, TRUE ); | |
772 | |
773 pCtbNtry -> numRawCauseBytes = 0; /* Reset the cause value after sending the info to SAT */ | |
774 | |
775 cmhCC_redialCheck(cId); | |
776 | |
777 /* | |
778 if( pCtbNtry -> CCBSstat EQ CCBSS_PSSBL OR | |
779 pCtbNtry -> calType EQ CT_NI_MOC ) | |
780 */ | |
781 switch (pCtbNtry->curCmd) | |
782 { | |
783 case( AT_CMD_A ): | |
784 case( AT_CMD_D ): | |
785 case( AT_CMD_NONE ): | |
786 case( AT_CMD_ABRT ): | |
787 { | |
788 cmhCC_CallDisconnected(cId); | |
789 cmhCC_CallReleased( cId ); | |
790 } | |
791 break; | |
792 | |
793 case( AT_CMD_H ): | |
794 case( AT_CMD_Z ): | |
795 case( AT_CMD_CHUP ): | |
796 case( AT_CMD_CHLD ): | |
797 | |
798 #ifdef FF_FAX | |
799 case( AT_CMD_FKS ): | |
800 case( AT_CMD_FDT ): | |
801 case( AT_CMD_FDR ): | |
802 #endif | |
803 { | |
804 cmhCC_CallDisconnected(cId); | |
805 cmhCC_CPIReleaseMsg(cId); | |
806 } | |
807 break; | |
808 } | |
809 | |
810 if (rdlPrm.rdlcId NEQ cId) | |
811 {/* if redialling is active no clean cId entry */ | |
812 /*patch BE 30.06.00 to remove every other call drops*/ | |
813 psaCC_FreeCtbNtry (cId); | |
814 /*end patch BE */ | |
815 } | |
816 | |
817 /* free the primitive buffer */ | |
818 PFREE (mncc_release_ind); | |
819 | |
820 } | |
821 | |
822 /* | |
823 +-------------------------------------------------------------------+ | |
824 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
825 | ROUTINE : psa_mncc_release_cnf | | |
826 +-------------------------------------------------------------------+ | |
827 | |
828 PURPOSE : processes the MNCC_RELEASE_CNF primitive send by CC. | |
829 this confirmates the release request for a call. | |
830 | |
831 */ | |
832 | |
833 GLOBAL const void psa_mncc_release_cnf | |
834 ( T_MNCC_RELEASE_CNF *mncc_release_cnf ) | |
835 { | |
836 SHORT cId; /* holds call id */ | |
837 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
838 | |
839 TRACE_FUNCTION ("psa_mncc_release_cnf()"); | |
840 | |
841 /* | |
842 *------------------------------------------------------------------- | |
843 * find call in call table | |
844 *------------------------------------------------------------------- | |
845 */ | |
846 cId = psaCC_ctbFindTi( mncc_release_cnf -> ti ); | |
847 | |
848 if( cId < 0 ) | |
849 { | |
850 psaCC_retMOCTi( mncc_release_cnf -> ti ); | |
851 | |
852 /* | |
853 * ignore primitive, due to not found transaction identifier. | |
854 */ | |
855 TRACE_EVENT ("primitive rejected due to unused ti"); | |
856 PFREE(mncc_release_cnf); | |
857 return; | |
858 } | |
859 | |
860 /* | |
861 *------------------------------------------------------------------- | |
862 * update shared parameter and notify ACI | |
863 *------------------------------------------------------------------- | |
864 */ | |
865 pCtbNtry = ccShrdPrm.ctb[cId]; | |
866 | |
867 /* HM 02-Aug-2002, done while merging SBK code, check again this code*/ | |
868 #if 0 /* Old code */ | |
869 if( mncc_release_cnf -> cause NEQ CAUSE_NOT_PRES ) | |
870 { | |
871 pCtbNtry -> nrmCs = mncc_release_cnf -> cause; | |
872 ccShrdPrm.cIdFail = cId; | |
873 #ifdef FF_EM_MODE | |
874 em_relcs = mncc_release_cnf -> cause; | |
875 #endif /* FF_EM_MODE */ | |
876 } | |
877 #endif /* #if 0 */ | |
878 | |
879 if (pCtbNtry -> nrmCs EQ MNCC_CAUSE_NO_MS_CAUSE) /* no Disconnect Cause available...*/ | |
880 { | |
881 pCtbNtry -> nrmCs = mncc_release_cnf -> cause; /* Recheck ###*/ | |
882 ccShrdPrm.cIdFail = cId; /* This line is considered harmful, only if cause present ### */ | |
883 #ifdef FF_EM_MODE | |
884 em_relcs = mncc_release_cnf -> cause; /* Recheck ### */ | |
885 #endif /* FF_EM_MODE */ | |
886 } | |
887 pCtbNtry -> rslt = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
888 pCtbNtry -> rejCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
889 pCtbNtry -> curCs = pCtbNtry -> rejCs; | |
890 pCtbNtry -> numRawCauseBytes = mncc_release_cnf -> c_raw_cause; | |
891 pCtbNtry -> rawCauseBytes = mncc_release_cnf -> raw_cause; | |
892 #ifdef SIM_TOOLKIT | |
893 if(!(pCtbNtry -> SATinv & SAT_REDIAL)) | |
894 #endif | |
895 pCtbNtry -> calStat = CS_IDL; | |
896 | |
897 psaCC_chngCalTypCnt( cId, -1 ); | |
898 psaCC_retMOCTi( pCtbNtry -> ti ); | |
899 | |
900 psaCC_send_satevent( EVENT_CALL_DISC, cId , FAR_END, TRUE ); | |
901 | |
902 pCtbNtry -> numRawCauseBytes = 0; /* Reset the cause value after sending the info to SAT */ | |
903 | |
904 cmhCC_redialCheck( cId); | |
905 | |
906 cmhCC_CallReleased (cId); | |
907 | |
908 /*patch BE 30.06.00 to remove every other call drops */ | |
909 { | |
910 #ifdef SIM_TOOLKIT | |
911 if ( (pCtbNtry -> SATinv & SAT_REDIAL) EQ 0 ) | |
912 { | |
913 #endif /* SIM_TOOLKIT */ | |
914 if (rdlPrm.rdlcId NEQ cId) | |
915 { | |
916 psaCC_FreeCtbNtry (cId); | |
917 } | |
918 #ifdef SIM_TOOLKIT | |
919 } | |
920 #endif /* SIM_TOOLKIT */ | |
921 } | |
922 /*end patch BE */ | |
923 | |
924 switch(CHLDaddInfo) | |
925 { | |
926 case (CHLD_ADD_INFO_DIAL_CAL): | |
927 cId = psaCC_ctbFindCall( NO_VLD_OWN, NO_VLD_CS, CT_MOC ); | |
928 if (cId NEQ NO_ENTRY) | |
929 { | |
930 cmhCC_NewCall(cId,psaCC_ctb(cId)->curSrc,AT_CMD_D); | |
931 } | |
932 break; | |
933 default: | |
934 break; | |
935 } | |
936 /* free the primitive buffer */ | |
937 PFREE (mncc_release_cnf); | |
938 | |
939 } | |
940 | |
941 /* | |
942 +-------------------------------------------------------------------+ | |
943 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
944 | ROUTINE : psa_mncc_disconnect_ind | | |
945 +-------------------------------------------------------------------+ | |
946 | |
947 PURPOSE : processes the MNCC_DISCONNECT_IND primitive send by CC. | |
948 this indicates the disconnection of a call. | |
949 | |
950 */ | |
951 | |
952 GLOBAL const void psa_mncc_disconnect_ind | |
953 ( T_MNCC_DISCONNECT_IND *mncc_disconnect_ind ) | |
954 { | |
955 SHORT cId; /* holds call id */ | |
956 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
957 BOOL held_call = FALSE; | |
958 | |
959 TRACE_FUNCTION ("psa_mncc_disconnect_ind()"); | |
960 | |
961 /* | |
962 *------------------------------------------------------------------- | |
963 * find call in call table | |
964 *------------------------------------------------------------------- | |
965 */ | |
966 cId = psaCC_ctbFindTi( mncc_disconnect_ind -> ti ); | |
967 | |
968 if( cId < 0 ) | |
969 { | |
970 /* | |
971 * ignore primitive, due to not found transaction identifier. | |
972 */ | |
973 TRACE_EVENT ("primitive rejected due to unused ti"); | |
974 PFREE(mncc_disconnect_ind); | |
975 return; | |
976 } | |
977 psaCC_StopDTMF ( cId ); /* HM 27.07.00 */ | |
978 | |
979 /* | |
980 *------------------------------------------------------------------- | |
981 * update shared parameter and notify ACI | |
982 *------------------------------------------------------------------- | |
983 */ | |
984 pCtbNtry = ccShrdPrm.ctb[cId]; | |
985 | |
986 pCtbNtry -> curCs = mncc_disconnect_ind -> cause; | |
987 | |
988 if( mncc_disconnect_ind->diagnostic EQ DIAG_CCBS_POSSIBLE ) | |
989 { | |
990 pCtbNtry -> CCBSstat = CCBSS_PSSBL; | |
991 } | |
992 | |
993 /* CQ 23619: copy ss diagnostic to shared parameters >> */ | |
994 pCtbNtry->ssDiag = mncc_disconnect_ind->ss_diag; | |
995 /* CQ 23619 << */ | |
996 | |
997 #if 0 | |
998 if( mncc_disconnect_ind -> cause NEQ CAUSE_NOT_PRES ) | |
999 { | |
1000 pCtbNtry -> nrmCs = mncc_disconnect_ind -> cause; | |
1001 ccShrdPrm.cIdFail = cId; | |
1002 #ifdef FF_EM_MODE | |
1003 em_relcs = mncc_disconnect_ind -> cause; | |
1004 #endif /* FF_EM_MODE */ | |
1005 } | |
1006 #endif | |
1007 | |
1008 pCtbNtry -> nrmCs = mncc_disconnect_ind -> cause; /* Recheck ### */ | |
1009 ccShrdPrm.cIdFail = cId; /* Recheck ### */ | |
1010 #ifdef FF_EM_MODE | |
1011 em_relcs = mncc_disconnect_ind -> cause; /* Recheck ### */ | |
1012 #endif /* FF_EM_MODE */ | |
1013 | |
1014 /* remember if call is currently on hold */ | |
1015 if (pCtbNtry -> calStat EQ CS_HLD) | |
1016 held_call = TRUE; | |
1017 | |
1018 /* calStat has to be set before calling psaCC_chkPrgDesc, otherwise | |
1019 no CPI event will be send */ | |
1020 pCtbNtry -> calStat = CS_DSC_REQ; | |
1021 | |
1022 /* check for TTY service */ | |
1023 /* cmhCC_TTY_Control ( cId ); */ | |
1024 | |
1025 /* check for progress descriptions */ | |
1026 psaCC_chkPrgDesc ( cId, mncc_disconnect_ind -> progress_desc, MT_DISC ); | |
1027 | |
1028 pCtbNtry -> rslt = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
1029 pCtbNtry -> rejCs = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, CC_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
1030 | |
1031 pCtbNtry -> numRawCauseBytes = mncc_disconnect_ind -> c_raw_cause; | |
1032 pCtbNtry -> rawCauseBytes = mncc_disconnect_ind -> raw_cause; | |
1033 | |
1034 psaCC_send_satevent( EVENT_CALL_DISC, cId , FAR_END, TRUE ); | |
1035 | |
1036 pCtbNtry -> numRawCauseBytes = 0; /* Reset the cause value after sending the info to SAT */ | |
1037 | |
1038 /* If call was held upon mncc_disconnect_ind it is cleared anyway */ | |
1039 if (held_call EQ TRUE) | |
1040 { | |
1041 TRACE_EVENT ("Release a held call"); | |
1042 cmhCC_CallDisconnected (cId); | |
1043 psaCC_ClearCall (cId); | |
1044 } | |
1045 else | |
1046 { | |
1047 switch( cmhCC_getcalltype(cId) ) | |
1048 { | |
1049 case( VOICE_CALL ): | |
1050 { | |
1051 /* | |
1052 * if in-band tones are available and TCH is assigned, request to disconnect the call | |
1053 * GSM 04.08/5.4.4.1.1.1 | |
1054 */ | |
1055 /* | |
1056 TRACE_EVENT("psa_mncc_disconnect_ind(): --> VOICE CALL"); | |
1057 if ((pCtbNtry -> inBndTns EQ TRUE) | |
1058 AND (pCtbNtry -> CCBSstat EQ NO_VLD_CCBSS) | |
1059 AND (ccShrdPrm.TCHasg EQ TRUE)) | |
1060 { | |
1061 cmhCC_DisconnectCall (cId); | |
1062 } | |
1063 else | |
1064 { | |
1065 cmhCC_CallDisconnected (cId); | |
1066 } | |
1067 */ | |
1068 /* check conditions for redialling */ | |
1069 if((pCtbNtry->curCmd NEQ AT_CMD_H) AND | |
1070 (pCtbNtry->curCmd NEQ AT_CMD_CHUP)) | |
1071 { | |
1072 cmhCC_redialCheck(cId); | |
1073 } | |
1074 | |
1075 | |
1076 /* | |
1077 * for CCBS support the "Prolonged Clearing Procedure" | |
1078 * GSM 04.08/5.4.4.2.1 | |
1079 */ | |
1080 cmhCC_CallDisconnected (cId); | |
1081 | |
1082 if ((pCtbNtry->inBndTns EQ TRUE) /* 5.4.4.2.1.1 */ | |
1083 AND (pCtbNtry->CCBSstat EQ NO_VLD_CCBSS)) | |
1084 { | |
1085 if (ccShrdPrm.TCHasg NEQ TRUE) | |
1086 { | |
1087 TRACE_EVENT ("4.08/5.4.4.2.1.1 i)"); | |
1088 psaCC_ClearCall (cId); | |
1089 } | |
1090 else | |
1091 { | |
1092 TRACE_EVENT ("4.08/5.4.4.2.1.1 ii)"); | |
1093 psaCC_setSpeechMode(); | |
1094 } | |
1095 } | |
1096 else if (pCtbNtry->CCBSstat EQ CCBSS_PSSBL) /* 5.4.4.2.2.1 */ | |
1097 { | |
1098 TRACE_EVENT ("4.08/5.4.4.2.2.1"); | |
1099 psaCC_setSpeechMode(); | |
1100 cmhCC_SndDiscRsn( cId ); /* FIXME: to emmit BUSY, but this is not good here | |
1101 since BUSY is final result code and will be | |
1102 emitted on Release again !!!!! */ | |
1103 } | |
1104 else if ((pCtbNtry->inBndTns NEQ TRUE) /* 5.4.4.2.3.1 */ | |
1105 AND (pCtbNtry->CCBSstat EQ NO_VLD_CCBSS)) | |
1106 { | |
1107 TRACE_EVENT ("4.08/5.4.4.2.3.1"); | |
1108 psaCC_ClearCall (cId); | |
1109 } | |
1110 else /* 5.4.4.2.3.2 */ | |
1111 { | |
1112 TRACE_EVENT ("4.08/5.4.4.2.3.2"); | |
1113 psaCC_ClearCall (cId); | |
1114 } | |
1115 break; | |
1116 } | |
1117 default: /* all non voice calls */ | |
1118 { | |
1119 /* | |
1120 * see cmh_cc.h T_CC_CALL_TYPE for all other call types | |
1121 */ | |
1122 TRACE_EVENT("psa_mncc_disconnect_ind(): --> DATA CALL"); | |
1123 cmhCC_CallDisconnected (cId); | |
1124 psaCC_ClearCall (cId); | |
1125 break; | |
1126 } | |
1127 } | |
1128 } /* else */ | |
1129 | |
1130 /* free the primitive buffer */ | |
1131 PFREE (mncc_disconnect_ind); | |
1132 } | |
1133 | |
1134 /* | |
1135 +-------------------------------------------------------------------+ | |
1136 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1137 | ROUTINE : psa_mncc_alert_ind | | |
1138 +-------------------------------------------------------------------+ | |
1139 | |
1140 PURPOSE : processes the MNCC_ALERT_IND primitive send by CC. | |
1141 this indicates that the called party is alerted. | |
1142 | |
1143 */ | |
1144 | |
1145 GLOBAL const void psa_mncc_alert_ind | |
1146 ( T_MNCC_ALERT_IND *mncc_alert_ind ) | |
1147 { | |
1148 SHORT cId; /* holds call id */ | |
1149 | |
1150 TRACE_FUNCTION ("psa_mncc_alert_ind()"); | |
1151 | |
1152 /* | |
1153 *------------------------------------------------------------------- | |
1154 * find call in call table | |
1155 *------------------------------------------------------------------- | |
1156 */ | |
1157 cId = psaCC_ctbFindTi( mncc_alert_ind -> ti ); | |
1158 | |
1159 if( cId < 0 ) | |
1160 { | |
1161 /* | |
1162 * ignore primitive, due to not found transaction identifier. | |
1163 */ | |
1164 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1165 PFREE(mncc_alert_ind); | |
1166 return; | |
1167 } | |
1168 | |
1169 /* | |
1170 *------------------------------------------------------------------- | |
1171 * update shared parameter and notify ACI | |
1172 *------------------------------------------------------------------- | |
1173 */ | |
1174 psaCC_ctb(cId)->alrtStat = AS_SND; | |
1175 psaCC_ctb(cId)->curCs = MNCC_CAUSE_NO_MS_CAUSE; | |
1176 | |
1177 /* check for progress descriptions */ | |
1178 psaCC_chkPrgDesc ( cId, mncc_alert_ind -> progress_desc, MT_ALRT ); | |
1179 | |
1180 /* check for TTY service */ | |
1181 cmhCC_TTY_Control ( cId, TTY_START ); | |
1182 /* | |
1183 *------------------------------------------------------------------- | |
1184 * free the primitive buffer | |
1185 *------------------------------------------------------------------- | |
1186 */ | |
1187 PFREE (mncc_alert_ind); | |
1188 } | |
1189 | |
1190 /* | |
1191 +-------------------------------------------------------------------+ | |
1192 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1193 | ROUTINE : psa_mncc_call_proceed_ind| | |
1194 +-------------------------------------------------------------------+ | |
1195 | |
1196 PURPOSE : processes the MNCC_CALL_PROCEED_IND primitive send by CC. | |
1197 this indicates a call proceeding information for a call. | |
1198 | |
1199 */ | |
1200 | |
1201 GLOBAL const void psa_mncc_call_proceed_ind | |
1202 ( T_MNCC_CALL_PROCEED_IND *mncc_call_proceed_ind ) | |
1203 { | |
1204 SHORT cId; /* holds call id */ | |
1205 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1206 | |
1207 TRACE_FUNCTION ("psa_mncc_call_proceed_ind()"); | |
1208 | |
1209 /* | |
1210 *------------------------------------------------------------------- | |
1211 * find call in call table | |
1212 *------------------------------------------------------------------- | |
1213 */ | |
1214 cId = psaCC_ctbFindTi( mncc_call_proceed_ind -> ti ); | |
1215 | |
1216 if( cId < 0 ) | |
1217 { | |
1218 /* | |
1219 * ignore primitive, due to not found transaction identifier. | |
1220 */ | |
1221 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1222 PFREE(mncc_call_proceed_ind); | |
1223 return; | |
1224 } | |
1225 | |
1226 /* | |
1227 *------------------------------------------------------------------- | |
1228 * update shared parameter and notify ACI | |
1229 *------------------------------------------------------------------- | |
1230 */ | |
1231 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1232 pCtbNtry -> curCs = MNCC_CAUSE_NO_MS_CAUSE; | |
1233 | |
1234 memcpy( &(pCtbNtry->BC[0]),&(mncc_call_proceed_ind->bcpara), | |
1235 sizeof( T_bcpara) ); | |
1236 memcpy( &(pCtbNtry->BC[1]),&(mncc_call_proceed_ind->bcpara2), | |
1237 sizeof( T_bcpara) ); | |
1238 pCtbNtry -> rptInd = mncc_call_proceed_ind -> ri; | |
1239 | |
1240 /* check for progress descriptions */ | |
1241 psaCC_chkPrgDesc ( cId, mncc_call_proceed_ind -> progress_desc, MT_PROC ); | |
1242 | |
1243 /* check for TTY service */ | |
1244 cmhCC_TTY_Control ( cId, TTY_START ); | |
1245 /* | |
1246 *------------------------------------------------------------------- | |
1247 * free the primitive buffer | |
1248 *------------------------------------------------------------------- | |
1249 */ | |
1250 PFREE (mncc_call_proceed_ind); | |
1251 | |
1252 } | |
1253 | |
1254 /* | |
1255 +-------------------------------------------------------------------+ | |
1256 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1257 | ROUTINE : psa_mncc_progress_ind | | |
1258 +-------------------------------------------------------------------+ | |
1259 | |
1260 PURPOSE : processes the MNCC_PROGRESS_IND primitive send by CC. | |
1261 this indicates a progress description for a call. | |
1262 | |
1263 */ | |
1264 | |
1265 GLOBAL const void psa_mncc_progress_ind | |
1266 ( T_MNCC_PROGRESS_IND *mncc_progress_ind ) | |
1267 { | |
1268 SHORT cId; /* holds call id */ | |
1269 | |
1270 TRACE_FUNCTION ("psa_mncc_progress_ind()"); | |
1271 | |
1272 /* | |
1273 *------------------------------------------------------------------- | |
1274 * find call in call table | |
1275 *------------------------------------------------------------------- | |
1276 */ | |
1277 cId = psaCC_ctbFindTi( mncc_progress_ind -> ti ); | |
1278 | |
1279 | |
1280 if( cId < 0 ) | |
1281 { | |
1282 /* | |
1283 * ignore primitive, due to not found transaction identifier. | |
1284 */ | |
1285 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1286 PFREE(mncc_progress_ind); | |
1287 return; | |
1288 } | |
1289 psaCC_ctb(cId)->curCs = MNCC_CAUSE_NO_MS_CAUSE; | |
1290 | |
1291 /* | |
1292 * check for progress descriptions | |
1293 */ | |
1294 psaCC_chkPrgDesc ( cId, mncc_progress_ind -> progress_desc, MT_PROGR ); | |
1295 | |
1296 /* | |
1297 *------------------------------------------------------------------- | |
1298 * free the primitive buffer | |
1299 *------------------------------------------------------------------- | |
1300 */ | |
1301 PFREE (mncc_progress_ind); | |
1302 | |
1303 } | |
1304 | |
1305 /* | |
1306 +-------------------------------------------------------------------+ | |
1307 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1308 | ROUTINE : psa_mncc_hold_cnf | | |
1309 +-------------------------------------------------------------------+ | |
1310 | |
1311 PURPOSE : processes the MNCC_HOLD_CNF primitive send by CC. | |
1312 this confirmates that a call is being held. | |
1313 | |
1314 */ | |
1315 | |
1316 GLOBAL const void psa_mncc_hold_cnf | |
1317 ( T_MNCC_HOLD_CNF *mncc_hold_cnf ) | |
1318 { | |
1319 SHORT cId; /* holds call id */ | |
1320 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1321 | |
1322 TRACE_FUNCTION ("psa_mncc_hold_cnf()"); | |
1323 | |
1324 /* | |
1325 *------------------------------------------------------------------- | |
1326 * find call in call table | |
1327 *------------------------------------------------------------------- | |
1328 */ | |
1329 cId = psaCC_ctbFindTi( mncc_hold_cnf -> ti ); | |
1330 | |
1331 if( cId < 0 ) | |
1332 { | |
1333 /* | |
1334 * ignore primitive, due to not found transaction identifier. | |
1335 */ | |
1336 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1337 PFREE(mncc_hold_cnf); | |
1338 return; | |
1339 } | |
1340 | |
1341 /* | |
1342 *------------------------------------------------------------------- | |
1343 * update shared parameter and notify ACI | |
1344 *------------------------------------------------------------------- | |
1345 */ | |
1346 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1347 | |
1348 switch( mncc_hold_cnf -> cause ) | |
1349 { | |
1350 case( MNCC_CAUSE_HOLD_SUCCESS ): /* successful, call held */ | |
1351 case( MNCC_CAUSE_SUCCESS ): | |
1352 case( MNCC_CAUSE_NO_MS_CAUSE ): | |
1353 | |
1354 pCtbNtry -> calStat = CS_HLD; | |
1355 | |
1356 psaCC_setSpeechMode (); | |
1357 | |
1358 /* check for TTY service */ | |
1359 cmhCC_TTY_Control ( cId, TTY_PAUSE ); | |
1360 break; | |
1361 | |
1362 default: /* unsuccessful, call state unchanged */ | |
1363 | |
1364 ccShrdPrm.cIdFail = cId; | |
1365 pCtbNtry -> calStat = CS_ACT; | |
1366 break; | |
1367 } | |
1368 | |
1369 pCtbNtry -> rslt = mncc_hold_cnf -> cause; | |
1370 | |
1371 cmhCC_CallHeld(cId); | |
1372 | |
1373 /* | |
1374 *------------------------------------------------------------------- | |
1375 * free the primitive buffer | |
1376 *------------------------------------------------------------------- | |
1377 */ | |
1378 PFREE (mncc_hold_cnf); | |
1379 | |
1380 } | |
1381 | |
1382 /* | |
1383 +-------------------------------------------------------------------+ | |
1384 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1385 | ROUTINE : psa_mncc_retrieve_cnf | | |
1386 +-------------------------------------------------------------------+ | |
1387 | |
1388 PURPOSE : processes the MNCC_RETRIEVE_CNF primitive send by CC. | |
1389 this confirmates that a call is retrieved. | |
1390 | |
1391 */ | |
1392 | |
1393 GLOBAL const void psa_mncc_retrieve_cnf | |
1394 ( T_MNCC_RETRIEVE_CNF *mncc_retrieve_cnf ) | |
1395 { | |
1396 SHORT cId; /* holds call id */ | |
1397 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1398 | |
1399 TRACE_FUNCTION ("psa_mncc_retrieve_cnf()"); | |
1400 | |
1401 /* | |
1402 *------------------------------------------------------------------- | |
1403 * find call in call table | |
1404 *------------------------------------------------------------------- | |
1405 */ | |
1406 cId = psaCC_ctbFindTi( mncc_retrieve_cnf -> ti ); | |
1407 | |
1408 if( cId < 0 ) | |
1409 { | |
1410 /* | |
1411 * ignore primitive, due to not found transaction identifier. | |
1412 */ | |
1413 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1414 PFREE(mncc_retrieve_cnf); | |
1415 return; | |
1416 } | |
1417 | |
1418 /* | |
1419 *------------------------------------------------------------------- | |
1420 * update shared parameter and notify ACI | |
1421 *------------------------------------------------------------------- | |
1422 */ | |
1423 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1424 | |
1425 switch( mncc_retrieve_cnf -> cause ) | |
1426 { | |
1427 case( MNCC_CAUSE_RETRIEVE_SUCCESS ): /* successful, call active */ | |
1428 | |
1429 pCtbNtry -> calStat = CS_ACT; | |
1430 | |
1431 /* switch on vocoder */ | |
1432 psaCC_setSpeechMode (); | |
1433 | |
1434 /* check for TTY service */ | |
1435 cmhCC_TTY_Control ( cId, TTY_START ); | |
1436 break; | |
1437 | |
1438 default: /* unsuccessful, call state unchanged */ | |
1439 | |
1440 ccShrdPrm.cIdFail = cId; | |
1441 pCtbNtry -> calStat = CS_HLD; | |
1442 break; | |
1443 } | |
1444 | |
1445 pCtbNtry -> rslt = mncc_retrieve_cnf -> cause; | |
1446 | |
1447 cmhCC_CallRetrieved (cId); | |
1448 | |
1449 /* | |
1450 *------------------------------------------------------------------- | |
1451 * free the primitive buffer | |
1452 *------------------------------------------------------------------- | |
1453 */ | |
1454 PFREE (mncc_retrieve_cnf); | |
1455 | |
1456 } | |
1457 | |
1458 /* | |
1459 +-------------------------------------------------------------------+ | |
1460 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1461 | ROUTINE : psa_mncc_sync_ind | | |
1462 +-------------------------------------------------------------------+ | |
1463 | |
1464 PURPOSE : processes the MNCC_SYNC_IND primitive send by CC. | |
1465 this indicates the change of the channel mode. | |
1466 | |
1467 */ | |
1468 | |
1469 GLOBAL const void psa_mncc_sync_ind( T_MNCC_SYNC_IND *mncc_sync_ind ) | |
1470 { | |
1471 SHORT cId = 0; /* holds call id */ | |
1472 | |
1473 TRACE_FUNCTION ("psa_mncc_sync_ind()"); | |
1474 | |
1475 /* | |
1476 cause cause 4.6 UBYTE | |
1477 channel mode chm 4.14 STRUCT | |
1478 | |
1479 ch_type 0 CH_SDCCH SDCCH channel | |
1480 1 CH_TCH_F TCH Fullrate | |
1481 2 CH_TCH_H TCH Halfrate | |
1482 | |
1483 ch_mode 0 CHM_SIG_ONLY signalling only | |
1484 1 CHM_SPEECH speech full rate or half rate version 1 | |
1485 33 CHM_SPEECH_V2 speech full rate or half rate version 2 | |
1486 65 CHM_SPEECH_V3 speech full rate or half rate version 3 | |
1487 3 CHM_DATA_9_6 data 9.6 kBit/s | |
1488 11 CHM_DATA_4_8 data 4.8 kBit/s | |
1489 19 CHM_DATA_2_4 data 2.4 kBit/s | |
1490 15 CHM_DATA_14_4 data 14.4 kBit/s | |
1491 */ | |
1492 | |
1493 TRACE_EVENT_P4("MNCC_SYNC_IND ti: %d, cause: %d, ch_type: %d, ch_mode: %d", | |
1494 mncc_sync_ind -> ti, | |
1495 mncc_sync_ind -> cause, | |
1496 mncc_sync_ind -> chm.ch_type, | |
1497 mncc_sync_ind -> chm.ch_mode); | |
1498 | |
1499 /* update shared parameter */ | |
1500 ccShrdPrm.syncCs = mncc_sync_ind -> cause; | |
1501 #ifdef FF_EM_MODE | |
1502 em_relcs = mncc_sync_ind -> cause; | |
1503 #endif /* FF_EM_MODE */ | |
1504 | |
1505 /* Inform Advice of Charge Module */ | |
1506 switch (mncc_sync_ind->cause) | |
1507 { | |
1508 case MNCC_CAUSE_REEST_STARTED: | |
1509 for( cId = 0; cId < MAX_CALL_NR; cId++ ) | |
1510 aoc_info (cId, AOC_SUSPEND_AOC); | |
1511 break; | |
1512 case MNCC_CAUSE_REEST_FINISHED: | |
1513 ccShrdPrm.aocRsmpPend = 1; | |
1514 break; | |
1515 } | |
1516 | |
1517 /* switch channel mode */ | |
1518 if( mncc_sync_ind -> chm.ch_mode NEQ NOT_PRESENT_8BIT ) | |
1519 { | |
1520 ccShrdPrm.chMod = mncc_sync_ind -> chm.ch_mode; | |
1521 ccShrdPrm.chType = mncc_sync_ind -> chm.ch_type; | |
1522 ccShrdPrm.TCHasg = TRUE; | |
1523 } | |
1524 | |
1525 if ( ccShrdPrm.aocRsmpPend AND | |
1526 (ccShrdPrm.chMod EQ CHM_SPEECH) OR | |
1527 (ccShrdPrm.chMod EQ CHM_SPEECH_V2) OR | |
1528 (ccShrdPrm.chMod EQ CHM_SPEECH_V3) ) | |
1529 { | |
1530 ccShrdPrm.aocRsmpPend = 0; | |
1531 for( cId = 0; cId < MAX_CALL_NR; cId++ ) | |
1532 aoc_info (cId, AOC_RESUME_AOC); | |
1533 } | |
1534 | |
1535 if( mncc_sync_ind -> chm.ch_mode NEQ NOT_PRESENT_8BIT ) | |
1536 { | |
1537 /* service a pending alert */ | |
1538 for( cId = 0; cId < MAX_CALL_NR; cId++ ) | |
1539 { | |
1540 if (ccShrdPrm.ctb[cId] NEQ NULL) | |
1541 { | |
1542 psaCC_ctb(cId)->curCs = mncc_sync_ind -> cause; | |
1543 | |
1544 if( psaCC_ctb(cId)->alrtStat EQ AS_PND AND | |
1545 psaCC_ctb(cId)->calStat EQ CS_ACT_REQ ) | |
1546 { | |
1547 { | |
1548 /* indicate alerting to network */ | |
1549 PALLOC (mncc_alert_req, MNCC_ALERT_REQ); | |
1550 mncc_alert_req -> ti = psaCC_ctb(cId)->ti; | |
1551 PSENDX (CC, mncc_alert_req); | |
1552 psaCC_ctb(cId)->alrtStat = AS_SND; | |
1553 } | |
1554 cmhCC_IncomingCall (cId); /* indicate an incoming call */ | |
1555 } | |
1556 if (psaCC_ctb(cId)->calStat NEQ CS_HLD AND | |
1557 psaCC_ctb(cId)->calStat NEQ CS_IDL) | |
1558 { | |
1559 /* check for TTY service */ | |
1560 cmhCC_TTY_Control ( cId, TTY_TCH ); | |
1561 } | |
1562 } | |
1563 } | |
1564 } | |
1565 psaCC_setSpeechMode (); | |
1566 | |
1567 /* Remember cause for Call Reestablishment*/ | |
1568 | |
1569 if (mncc_sync_ind -> cause EQ MNCC_CAUSE_REEST_FINISHED | |
1570 OR mncc_sync_ind -> cause EQ MNCC_CAUSE_REEST_STARTED) | |
1571 { | |
1572 for( cId = 0; cId < MAX_CALL_NR; cId++ ) | |
1573 { | |
1574 if (ccShrdPrm.ctb[cId] NEQ NULL) | |
1575 { | |
1576 psaCC_ctb(cId)->curCs = mncc_sync_ind -> cause; | |
1577 } | |
1578 } | |
1579 } | |
1580 | |
1581 cId = psaCC_ctbFindTi( mncc_sync_ind -> ti ); | |
1582 | |
1583 /* For channel synchronization events the cId needs not to be valid here */ | |
1584 cmhCC_Synchronized( cId ); | |
1585 | |
1586 | |
1587 /* free the primitive buffer */ | |
1588 PFREE (mncc_sync_ind); | |
1589 } | |
1590 | |
1591 /* | |
1592 +-------------------------------------------------------------------+ | |
1593 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1594 | ROUTINE : psa_mncc_user_ind | | |
1595 +-------------------------------------------------------------------+ | |
1596 | |
1597 PURPOSE : processes the MNCC_USER_IND primitive send by CC. | |
1598 this indicates the receiving of user data. | |
1599 */ | |
1600 | |
1601 GLOBAL const void psa_mncc_user_ind( T_MNCC_USER_IND *mncc_user_ind ) | |
1602 { | |
1603 TRACE_FUNCTION ("psa_mncc_user_ind()"); | |
1604 | |
1605 PFREE (mncc_user_ind); | |
1606 } | |
1607 | |
1608 /* | |
1609 +-------------------------------------------------------------------+ | |
1610 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1611 | ROUTINE : psa_mncc_start_dtmf_cnf | | |
1612 +-------------------------------------------------------------------+ | |
1613 | |
1614 PURPOSE : processes the MNCC_START_DTMF_CNF primitive send by CC. | |
1615 this is a confirmation for the sent DTMF tones. | |
1616 | |
1617 */ | |
1618 | |
1619 GLOBAL const void psa_mncc_start_dtmf_cnf | |
1620 ( T_MNCC_START_DTMF_CNF *mncc_start_dtmf_cnf ) | |
1621 { | |
1622 SHORT cId; /* holds call id */ | |
1623 | |
1624 TRACE_FUNCTION ("psa_mncc_start_dtmf_cnf()"); | |
1625 | |
1626 /* | |
1627 *------------------------------------------------------------------- | |
1628 * find call in call table | |
1629 *------------------------------------------------------------------- | |
1630 */ | |
1631 cId = psaCC_ctbFindTi( mncc_start_dtmf_cnf -> ti ); | |
1632 | |
1633 if( cId < 0 ) | |
1634 { | |
1635 /* | |
1636 * ignore primitive, due to not found transaction identifier. | |
1637 */ | |
1638 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1639 PFREE(mncc_start_dtmf_cnf); | |
1640 return; | |
1641 } | |
1642 | |
1643 /* | |
1644 *------------------------------------------------------------------- | |
1645 * update shared parameter and notify ACI | |
1646 *------------------------------------------------------------------- | |
1647 */ | |
1648 psaCC_ctb(cId)->nrmCs = mncc_start_dtmf_cnf -> cause; | |
1649 if ((mncc_start_dtmf_cnf->cause EQ MNCC_CAUSE_DTMF_STOP_SUCCESS) AND | |
1650 (mncc_start_dtmf_cnf->dtmf_mod EQ DTMF_MOD_MAN_STOP)) | |
1651 { | |
1652 /* Reset the current dtmf digit */ | |
1653 ccShrdPrm.dtmf.cur = 0; | |
1654 } | |
1655 #ifdef FF_EM_MODE | |
1656 em_relcs = mncc_start_dtmf_cnf -> cause; | |
1657 #endif /* FF_EM_MODE */ | |
1658 | |
1659 psaCC_DTMFSent( cId ); | |
1660 | |
1661 /* | |
1662 *------------------------------------------------------------------- | |
1663 * free the primitive buffer | |
1664 *------------------------------------------------------------------- | |
1665 */ | |
1666 PFREE (mncc_start_dtmf_cnf); | |
1667 | |
1668 } | |
1669 | |
1670 /* | |
1671 +-------------------------------------------------------------------+ | |
1672 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1673 | ROUTINE : psa_mncc_modify_ind | | |
1674 +-------------------------------------------------------------------+ | |
1675 | |
1676 PURPOSE : processes the MNCC_MODIFY_IND primitive send by CC. | |
1677 this indicates a mobile terminated in-call modification. | |
1678 | |
1679 */ | |
1680 | |
1681 GLOBAL const void psa_mncc_modify_ind | |
1682 ( T_MNCC_MODIFY_IND *mncc_modify_ind ) | |
1683 { | |
1684 SHORT cId; /* holds call id */ | |
1685 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1686 | |
1687 TRACE_FUNCTION ("psa_mncc_modify_ind()"); | |
1688 | |
1689 /* | |
1690 *------------------------------------------------------------------- | |
1691 * find call in call table | |
1692 *------------------------------------------------------------------- | |
1693 */ | |
1694 cId = psaCC_ctbFindTi( mncc_modify_ind -> ti ); | |
1695 | |
1696 if( cId < 0 ) | |
1697 { | |
1698 /* | |
1699 * ignore primitive, due to not found transaction identifier. | |
1700 */ | |
1701 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1702 PFREE(mncc_modify_ind); | |
1703 return; | |
1704 } | |
1705 | |
1706 /* check for TTY service */ | |
1707 cmhCC_TTY_Control ( cId, TTY_PAUSE ); | |
1708 | |
1709 /* | |
1710 *------------------------------------------------------------------- | |
1711 * update shared parameter and notify ACI | |
1712 *------------------------------------------------------------------- | |
1713 */ | |
1714 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1715 | |
1716 pCtbNtry -> curBC = (pCtbNtry -> curBC EQ 0)?1:0; | |
1717 pCtbNtry -> rslt = MNCC_CAUSE_MODIFY_SUCCESS; /* SBK-02-07-30: possibly to be revised as strictly speaking ACI is orignating entity */ | |
1718 | |
1719 cmhCC_CallModified (cId); | |
1720 | |
1721 /* check for TTY service */ | |
1722 cmhCC_TTY_Control ( cId, TTY_START ); | |
1723 | |
1724 psaCC_StopDTMF ( cId ); | |
1725 /* | |
1726 *------------------------------------------------------------------- | |
1727 * free the primitive buffer | |
1728 *------------------------------------------------------------------- | |
1729 */ | |
1730 PFREE (mncc_modify_ind); | |
1731 | |
1732 } | |
1733 | |
1734 /* | |
1735 +-------------------------------------------------------------------+ | |
1736 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1737 | ROUTINE : psa_mncc_modify_cnf | | |
1738 +-------------------------------------------------------------------+ | |
1739 | |
1740 PURPOSE : processes the MNCC_MODIFY_CNF primitive send by CC. | |
1741 this indicates the result for a mobile originated in-call | |
1742 modification. | |
1743 | |
1744 */ | |
1745 | |
1746 GLOBAL const void psa_mncc_modify_cnf | |
1747 ( T_MNCC_MODIFY_CNF *mncc_modify_cnf ) | |
1748 { | |
1749 SHORT cId; /* holds call id */ | |
1750 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1751 | |
1752 TRACE_FUNCTION ("psa_mncc_modify_cnf()"); | |
1753 | |
1754 /* | |
1755 *------------------------------------------------------------------- | |
1756 * find call in call table | |
1757 *------------------------------------------------------------------- | |
1758 */ | |
1759 cId = psaCC_ctbFindTi( mncc_modify_cnf -> ti ); | |
1760 | |
1761 if( cId < 0 ) | |
1762 { | |
1763 /* | |
1764 * ignore primitive, due to not found transaction identifier. | |
1765 */ | |
1766 TRACE_EVENT ("primitive rejected due to unused ti"); | |
1767 PFREE(mncc_modify_cnf); | |
1768 return; | |
1769 } | |
1770 | |
1771 /* | |
1772 *------------------------------------------------------------------- | |
1773 * update shared parameter and notify ACI | |
1774 *------------------------------------------------------------------- | |
1775 */ | |
1776 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1777 | |
1778 pCtbNtry -> rslt = mncc_modify_cnf -> cause; | |
1779 | |
1780 switch( mncc_modify_cnf -> cause ) | |
1781 { | |
1782 case( MNCC_CAUSE_MODIFY_SUCCESS ): /* successful modification */ | |
1783 | |
1784 pCtbNtry -> curBC = (pCtbNtry -> curBC EQ 0)?1:0; | |
1785 break; | |
1786 | |
1787 default: /* unsuccessful modification */ | |
1788 | |
1789 ccShrdPrm.cIdFail = cId; | |
1790 break; | |
1791 } | |
1792 psaCC_ctb(cId)->calStat = CS_ACT; | |
1793 | |
1794 cmhCC_CallModified (cId); | |
1795 | |
1796 /* check for TTY service */ | |
1797 cmhCC_TTY_Control ( cId, TTY_START ); | |
1798 | |
1799 /* | |
1800 *------------------------------------------------------------------- | |
1801 * free the primitive buffer | |
1802 *------------------------------------------------------------------- | |
1803 */ | |
1804 PFREE (mncc_modify_cnf); | |
1805 | |
1806 } | |
1807 | |
1808 /* | |
1809 +-------------------------------------------------------------------+ | |
1810 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1811 | ROUTINE : psa_mncc_bearer_cap_cnf | | |
1812 +-------------------------------------------------------------------+ | |
1813 | |
1814 PURPOSE : processes the MNCC_BEARER_CAP_CNF primitive send by CC. | |
1815 this is the result of the requested bearer coding/decoding. | |
1816 | |
1817 */ | |
1818 | |
1819 GLOBAL const void psa_mncc_bearer_cap_cnf | |
1820 ( T_MNCC_BEARER_CAP_CNF *mncc_bearer_cap_cnf ) | |
1821 { | |
1822 | |
1823 TRACE_FUNCTION ("psa_mncc_bearer_cap_cnf()"); | |
1824 | |
1825 /* | |
1826 *------------------------------------------------------------------- | |
1827 * determine request id | |
1828 *------------------------------------------------------------------- | |
1829 */ | |
1830 switch( mncc_bearer_cap_cnf -> req_id ) | |
1831 { | |
1832 | |
1833 #ifdef SIM_TOOLKIT | |
1834 | |
1835 case( BCRI_SAT ): | |
1836 | |
1837 switch( mncc_bearer_cap_cnf -> bc_mod ) | |
1838 { | |
1839 case( BC_MOD_CODE ): | |
1840 | |
1841 cmhSAT_ResCapCode ( mncc_bearer_cap_cnf -> cause, | |
1842 &mncc_bearer_cap_cnf -> bcconf ); | |
1843 break; | |
1844 | |
1845 case( BC_MOD_DECODE ): | |
1846 | |
1847 cmhSAT_ResCapDecode ( mncc_bearer_cap_cnf -> cause, | |
1848 &mncc_bearer_cap_cnf -> bcpara ); | |
1849 break; | |
1850 } | |
1851 break; | |
1852 | |
1853 #endif | |
1854 } | |
1855 | |
1856 /* | |
1857 *------------------------------------------------------------------- | |
1858 * free the primitive buffer | |
1859 *------------------------------------------------------------------- | |
1860 */ | |
1861 PFREE (mncc_bearer_cap_cnf); | |
1862 | |
1863 } | |
1864 | |
1865 /* | |
1866 +-------------------------------------------------------------------+ | |
1867 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1868 | ROUTINE : psa_mncc_prompt_ind | | |
1869 +-------------------------------------------------------------------+ | |
1870 | |
1871 PURPOSE : processes the MNCC_PROMPT_IND primitive send by CC. | |
1872 this requests a transaction identifier for a CCBS recall. | |
1873 | |
1874 */ | |
1875 | |
1876 GLOBAL const void psa_mncc_prompt_ind | |
1877 ( T_MNCC_PROMPT_IND *mncc_prompt_ind ) | |
1878 { | |
1879 SHORT ti; | |
1880 | |
1881 TRACE_FUNCTION ("psa_mncc_prompt_ind()"); | |
1882 | |
1883 /* | |
1884 *------------------------------------------------------------------- | |
1885 * allocate transaction identifier | |
1886 *------------------------------------------------------------------- | |
1887 */ | |
1888 ti = psaCC_getMOCTi( -1 ); | |
1889 | |
1890 if( ti NEQ -1 ) | |
1891 { | |
1892 PALLOC (mncc_prompt_rsp, MNCC_PROMPT_RSP); | |
1893 mncc_prompt_rsp -> ti = (UBYTE)ti; | |
1894 PSENDX (CC, mncc_prompt_rsp); | |
1895 } | |
1896 else | |
1897 { | |
1898 PALLOC (mncc_prompt_rej, MNCC_PROMPT_REJ); | |
1899 PSENDX (CC, mncc_prompt_rej); | |
1900 } | |
1901 | |
1902 /* | |
1903 *------------------------------------------------------------------- | |
1904 * free the primitive buffer | |
1905 *------------------------------------------------------------------- | |
1906 */ | |
1907 PFREE (mncc_prompt_ind); | |
1908 | |
1909 } | |
1910 | |
1911 /* | |
1912 +-------------------------------------------------------------------+ | |
1913 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
1914 | ROUTINE : psa_mncc_recall_ind | | |
1915 +-------------------------------------------------------------------+ | |
1916 | |
1917 PURPOSE : processes the MNCC_RECALL_IND primitive send by CC. | |
1918 this indicates a recall attempt from the network in case | |
1919 of CCBS. | |
1920 | |
1921 */ | |
1922 | |
1923 GLOBAL const void psa_mncc_recall_ind | |
1924 ( T_MNCC_RECALL_IND *mncc_recall_ind ) | |
1925 { | |
1926 SHORT cId; /* holds call table identifier */ | |
1927 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */ | |
1928 | |
1929 TRACE_FUNCTION ("psa_mncc_recall_ind()"); | |
1930 | |
1931 /* | |
1932 *------------------------------------------------------------------- | |
1933 * check for K.O. criteria | |
1934 *------------------------------------------------------------------- | |
1935 */ | |
1936 if( aoc_check_moc() EQ FALSE ) | |
1937 { | |
1938 PALLOC (mncc_reject_req, MNCC_REJECT_REQ); | |
1939 | |
1940 mncc_reject_req -> ti = mncc_recall_ind -> ti; | |
1941 mncc_reject_req -> cause = MNCC_CAUSE_ACM_MAX; | |
1942 | |
1943 PSENDX (CC, mncc_reject_req); | |
1944 } | |
1945 | |
1946 else if((cId = psaCC_ctbNewEntry()) < 0 ) | |
1947 { | |
1948 PALLOC (mncc_reject_req, MNCC_REJECT_REQ); | |
1949 | |
1950 mncc_reject_req -> ti = mncc_recall_ind -> ti; | |
1951 mncc_reject_req -> cause = MNCC_CAUSE_USER_BUSY; | |
1952 | |
1953 PSENDX (CC, mncc_reject_req); | |
1954 } | |
1955 | |
1956 /* | |
1957 *------------------------------------------------------------------- | |
1958 * insert recall parameters into call table entry | |
1959 *------------------------------------------------------------------- | |
1960 */ | |
1961 else | |
1962 { | |
1963 pCtbNtry = ccShrdPrm.ctb[cId]; | |
1964 | |
1965 pCtbNtry -> ti = mncc_recall_ind -> ti; | |
1966 pCtbNtry -> rptInd = mncc_recall_ind -> ri; | |
1967 | |
1968 /* | |
1969 * Assign called party | |
1970 */ | |
1971 pCtbNtry -> cldPty.ton = mncc_recall_ind -> called_party.ton; | |
1972 pCtbNtry -> cldPty.npi = mncc_recall_ind -> called_party.npi; | |
1973 pCtbNtry -> cldPty.c_called_num = | |
1974 mncc_recall_ind -> called_party.c_called_num; | |
1975 if (pCtbNtry -> cldPty.called_num NEQ NULL) | |
1976 { | |
1977 ACI_MFREE (pCtbNtry -> cldPty.called_num); | |
1978 pCtbNtry -> cldPty.called_num = NULL; | |
1979 } | |
1980 if (pCtbNtry -> cldPty.c_called_num NEQ 0) | |
1981 { | |
1982 ACI_MALLOC (pCtbNtry -> cldPty.called_num, | |
1983 pCtbNtry -> cldPty.c_called_num); | |
1984 memcpy (pCtbNtry -> cldPty.called_num, | |
1985 mncc_recall_ind -> called_party.called_num, | |
1986 mncc_recall_ind -> called_party.c_called_num); | |
1987 } | |
1988 | |
1989 /* | |
1990 * Assign called party subaddress | |
1991 */ | |
1992 pCtbNtry -> cldPtySub = mncc_recall_ind -> called_party_sub; | |
1993 | |
1994 /* | |
1995 * Assign bearer caps | |
1996 */ | |
1997 memcpy( &(pCtbNtry->BC[0]),&(mncc_recall_ind->bcpara), | |
1998 sizeof( T_bcpara) ); | |
1999 memcpy( &(pCtbNtry->BC[1]),&(mncc_recall_ind->bcpara2), | |
2000 sizeof( T_bcpara) ); | |
2001 | |
2002 psaCC_phbSrchNum( cId, CT_NI_MOC ); | |
2003 | |
2004 pCtbNtry -> calStat = CS_ACT_REQ; | |
2005 pCtbNtry -> calType = CT_NI_MOC; | |
2006 | |
2007 pCtbNtry -> prio = PRIO_NORM_CALL; | |
2008 pCtbNtry -> curBC = 0; | |
2009 | |
2010 } | |
2011 | |
2012 /* | |
2013 *------------------------------------------------------------------- | |
2014 * free the primitive buffer | |
2015 *------------------------------------------------------------------- | |
2016 */ | |
2017 PFREE (mncc_recall_ind); | |
2018 | |
2019 } | |
2020 | |
2021 /* | |
2022 +-------------------------------------------------------------------+ | |
2023 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
2024 | ROUTINE : psa_mncc_status_ind | | |
2025 +-------------------------------------------------------------------+ | |
2026 | |
2027 PURPOSE : processes the MNCC_STATUS_IND primitive sent by CC. | |
2028 This indicates that a STATUS ENQUIRY message has been | |
2029 received by CC, the network awaits a CC STATUS message. | |
2030 Used to ensure that the auxiliary states between ACI and | |
2031 CC were synchronized before the STATUS message is sent. | |
2032 | |
2033 */ | |
2034 | |
2035 GLOBAL const void psa_mncc_status_ind (T_MNCC_STATUS_IND *mncc_status_ind) | |
2036 { | |
2037 UBYTE ti; | |
2038 | |
2039 TRACE_FUNCTION ("psa_mncc_status_ind()"); | |
2040 | |
2041 ti = mncc_status_ind->ti; | |
2042 | |
2043 { | |
2044 PREUSE (mncc_status_ind, mncc_status_res, MNCC_STATUS_RES); | |
2045 mncc_status_res->ti = ti; | |
2046 PSENDX (CC, mncc_status_res); | |
2047 } | |
2048 } | |
2049 | |
2050 /* | |
2051 +-------------------------------------------------------------------+ | |
2052 | PROJECT : GSM-PS (6147) MODULE : PSA_CCP | | |
2053 | ROUTINE : psa_mncc_facility_ind | | |
2054 +-------------------------------------------------------------------+ | |
2055 | |
2056 PURPOSE : processes the MNCC_FACILITY_IND primitive send by CC. | |
2057 this indicates the receiving of a facility information | |
2058 element. Handles multiple components in the facility info. | |
2059 | |
2060 */ | |
2061 | |
2062 GLOBAL const void psa_mncc_facility_ind(T_MNCC_FACILITY_IND * mncc_facility_ind) | |
2063 { | |
2064 UBYTE tlen = 0; | |
2065 USHORT offset_comp = 0, total_len = mncc_facility_ind->fac_inf.l_fac/8; | |
2066 UBYTE len_comp = 0; | |
2067 UBYTE *tPtrfac = mncc_facility_ind->fac_inf.fac; | |
2068 | |
2069 TRACE_FUNCTION ("psa_mncc_facility_ind()"); | |
2070 | |
2071 if (tPtrfac[1] > 0x7F)/* For the case, when length is coded in non-standard way (0x80, 0x81, 0x82) we will be able to process only one component */ | |
2072 { | |
2073 psaCC_ProcessCmp((T_MNCC_FACILITY_IND *)mncc_facility_ind); | |
2074 return; | |
2075 } | |
2076 | |
2077 offset_comp = mncc_facility_ind->fac_inf.o_fac; | |
2078 len_comp = tlen = tPtrfac[1] + 2; | |
2079 | |
2080 for ( ; total_len >= len_comp; len_comp+=tlen) | |
2081 { | |
2082 if ((*tPtrfac EQ 0xA1) OR | |
2083 (*tPtrfac EQ 0xA2) OR | |
2084 (*tPtrfac EQ 0xA3) OR | |
2085 (*tPtrfac EQ 0xA4)) | |
2086 { | |
2087 PALLOC(new_mncc_facility_ind, MNCC_FACILITY_IND); | |
2088 | |
2089 new_mncc_facility_ind->ti = mncc_facility_ind->ti; | |
2090 new_mncc_facility_ind->fac_context = mncc_facility_ind->fac_context; | |
2091 new_mncc_facility_ind->fac_inf.l_fac = tlen * 8; | |
2092 new_mncc_facility_ind->fac_inf.o_fac = offset_comp; | |
2093 memcpy(new_mncc_facility_ind->fac_inf.fac, tPtrfac, tlen); | |
2094 | |
2095 psaCC_ProcessCmp((T_MNCC_FACILITY_IND *)new_mncc_facility_ind); | |
2096 | |
2097 tPtrfac = tPtrfac + tlen; | |
2098 tlen = tPtrfac[1] + 2; | |
2099 offset_comp = 0; | |
2100 } | |
2101 } | |
2102 | |
2103 PFREE(mncc_facility_ind); | |
2104 } | |
2105 | |
2106 /*==== EOF =========================================================*/ |