comparison src/aci2/aci/psa_ccs.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : PSA_CCS
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 signalling functions of the
18 | protocol stack adapter for call control.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef PSA_CCS_C
23 #define PSA_CCS_C
24 #endif
25
26 #include "aci_all.h"
27
28 /*==== INCLUDES ===================================================*/
29 #include "ccdapi.h"
30
31 #include "aci_cmh.h"
32 #include "ati_cmd.h"
33 #include "aci_cmd.h"
34 #include "aci.h"
35 #include "psa.h"
36 #include "psa_cc.h"
37 #include "psa_ss.h"
38 #include "aoc.h"
39 #include "l4_tim.h"
40
41 #if !defined (MFW)
42 #include "aci_io.h"
43 #endif
44
45 #include "aci_fd.h"
46 #include "cmh.h"
47
48 #include "cmh_cc.h"
49 #include "psa_cc.h"
50
51 #include "wap_aci.h"
52
53 /*==== CONSTANTS ==================================================*/
54
55 /*==== TYPES ======================================================*/
56
57 /*==== IMPORT =====================================================*/
58
59 /*==== VARIABLES ==================================================*/
60
61 /*==== FUNCTIONS ==================================================*/
62
63
64 /*
65 +-------------------------------------------------------------------+
66 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
67 | ROUTINE : psaCC_NewCall |
68 +-------------------------------------------------------------------+
69
70 PURPOSE : setup a new call
71
72 */
73
74 GLOBAL SHORT psaCC_NewCall ( SHORT cId )
75 {
76 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
77
78 TRACE_FUNCTION ("psaCC_NewCall()");
79
80 if (pCtbNtry EQ NULL)
81 return -1;
82
83 /* get a valid ti for a MOC, otherwise return */
84 if (psaCC_ctb(cId)->calType NEQ CT_NI_MOC )
85 {
86 if( psaCC_getMOCTi( cId ) < 0 ) return ( -1 );
87 }
88
89 #if defined (FF_WAP) || defined (FF_GPF_TCPIP) || defined (FF_SAT_E)
90 /* if this call is a WAP call then set wapId to the current Call Id */
91 if (Wap_Call EQ TRUE)
92 {
93 wapId = cId;
94 }
95 #endif /* defined(WAP) OR defined(FF_GPF_TCPIP) */
96
97 /*
98 *-------------------------------------------------------------------
99 * create and send primitive
100 *-------------------------------------------------------------------
101 */
102 {
103 PALLOC (mncc_setup_req, MNCC_SETUP_REQ);
104
105 /*
106 * fill in primitive parameter: setup request
107 */
108 mncc_setup_req -> ti = pCtbNtry -> ti;
109 mncc_setup_req -> prio = pCtbNtry -> prio;
110 mncc_setup_req -> ri = pCtbNtry -> rptInd;
111
112 mncc_setup_req->called_party.ton = pCtbNtry->cldPty.ton;
113 mncc_setup_req->called_party.npi = pCtbNtry->cldPty.npi;
114 mncc_setup_req->called_party.c_called_num = pCtbNtry->cldPty.c_called_num;
115 memcpy (mncc_setup_req->called_party.called_num,
116 pCtbNtry->cldPty.called_num,
117 pCtbNtry->cldPty.c_called_num);
118
119 mncc_setup_req -> called_party_sub = pCtbNtry -> cldPtySub;
120 mncc_setup_req -> clir_sup = pCtbNtry -> CLIRsup;
121 memcpy( &(mncc_setup_req->bcpara),&(pCtbNtry->BC[0]),
122 sizeof( T_bcpara) );
123 memcpy( &(mncc_setup_req->bcpara2),&(pCtbNtry->BC[1]),
124 sizeof( T_bcpara) );
125
126 /*
127 * fill in CUG info facility
128 */
129 if( !(pCtbNtry -> CUGidx EQ NOT_PRESENT_8BIT AND
130 pCtbNtry -> CUGprf EQ FALSE AND
131 pCtbNtry -> OAsup EQ FALSE ))
132 {
133 CCD_START;
134 psaCC_asmCUGInfo( cId );
135
136 {
137 UBYTE ccdRet;
138
139 MCAST( com, COMPONENT );
140
141 memset( com, 0, sizeof( T_COMPONENT ));
142
143 com -> v_inv_comp = TRUE;
144 com -> inv_comp.v_inv_id = TRUE;
145 com -> inv_comp.inv_id = pCtbNtry -> iId
146 = ccShrdPrm.iIdNxt++;
147 com -> inv_comp.v_op_code = TRUE;
148 com -> inv_comp.op_code = pCtbNtry -> opCode
149 = ssFIECodeBuf.buf[0];
150 com -> inv_comp.v_params = TRUE;
151 com -> inv_comp.params.l_params = ssFIECodeBuf.l_buf-8;
152 com -> inv_comp.params.o_params = 8;
153 memcpy( com -> inv_comp.params.b_params,
154 ssFIECodeBuf.buf, ssFIECodeBuf.l_buf );
155
156 mncc_setup_req -> fac_inf.l_fac = FACILITY_LEN<<3;
157 mncc_setup_req -> fac_inf.o_fac = 0;
158 ccdRet = ccd_codeMsg (CCDENT_FAC,
159 UPLINK,
160 (T_MSGBUF *) &mncc_setup_req -> fac_inf,
161 (UBYTE *) _decodedMsg,
162 COMPONENT);
163
164 if( ccdRet NEQ ccdOK )
165 {
166 TRACE_EVENT_P1("CCD Coding Error: %d",ccdRet );
167 memset( &mncc_setup_req -> fac_inf, 0, sizeof( T_fac_inf));
168 }
169 }
170 CCD_END;
171 }
172 else
173 {
174 memset( &mncc_setup_req -> fac_inf, 0, sizeof( T_fac_inf));
175 }
176
177 if(pCtbNtry -> calType NEQ CT_MOC_RDL)
178 {
179 pCtbNtry -> calType = CT_MOC;
180 }
181 pCtbNtry -> curBC = 0;
182
183 PSENDX (CC, mncc_setup_req);
184
185 /*
186 * update call status
187 */
188 pCtbNtry -> calStat = CS_ACT_REQ;
189 }
190 #ifdef FF_TTY
191 /* TTY notification */
192 cmhCC_notifyTTY (((pCtbNtry->BC[0].bearer_serv EQ BEARER_SERV_SPEECH_CTM OR
193 pCtbNtry->BC[0].bearer_serv EQ BEARER_SERV_AUX_SPEECH_CTM)?
194 CTTY_NEG_Request: CTTY_NEG_None),
195 CTTY_TRX_Unknown);
196 #endif /* FF_TTY */
197 if(cmhCC_atdsendok ( cId ))
198 {
199 R_AT( RAT_OK, pCtbNtry->curSrc ) ( pCtbNtry->curCmd );
200 }
201
202 /* start call time measurement */
203 aoc_info (cId, AOC_START_TIME);
204
205 /* Disable voice path in case this is first call */
206 psaCC_setSpeechMode ();
207
208 return 0;
209 }
210
211 /*
212 +-------------------------------------------------------------------+
213 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
214 | ROUTINE : psaCC_AcceptCall |
215 +-------------------------------------------------------------------+
216 PURPOSE : In addition to sending the setup response for an MT call
217 this function enables the vocoder if the call is a voice
218 call
219 */
220
221 GLOBAL void psaCC_AcceptCall ( SHORT cId )
222 {
223 T_CC_CALL_TBL * pCtbNtry; /* holds pointer to call table entry */
224
225 TRACE_FUNCTION ("psaCC_AcceptCall()");
226
227 /* update call status and attach the user if not done previously */
228 pCtbNtry = ccShrdPrm.ctb[cId];
229 pCtbNtry -> calStat = CS_CPL_REQ;
230 psaCC_setSpeechMode();
231
232 /* create and send primitive */
233 {
234 PALLOC (mncc_setup_res, MNCC_SETUP_RES);
235 mncc_setup_res -> ti = pCtbNtry -> ti;
236 PSENDX (CC, mncc_setup_res);
237 psaCC_send_satevent( EVENT_CALL_CONN, cId, NEAR_END, FALSE );
238 }
239
240 /* start call time measurement */
241 aoc_info (cId, AOC_START_TIME);
242 }
243
244 /*
245 +-------------------------------------------------------------------+
246 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
247 | ROUTINE : psaCC_ClearCall |
248 +-------------------------------------------------------------------+
249
250 PURPOSE : clear a call
251 */
252
253 GLOBAL void psaCC_ClearCall ( SHORT cId )
254 {
255 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
256
257 TRACE_FUNCTION ("psaCC_ClearCall()");
258
259 if (!psaCC_ctbIsValid (cId))
260 return; /* Ensure we are not dereferencing NULL */
261
262 psaCC_StopDTMF ( cId );
263
264 /* inform advice of charge module */
265 aoc_info (cId, AOC_STOP_TIME);
266
267 /*
268 *-----------------------------------------------------------------
269 * relase call if in disconnect request state
270 *-----------------------------------------------------------------
271 */
272 if( pCtbNtry -> calStat EQ CS_DSC_REQ )
273 {
274 PALLOC (mncc_release_req, MNCC_RELEASE_REQ);
275
276 /* fill in primitive parameter: release request */
277 mncc_release_req -> ti = pCtbNtry -> ti;
278 mncc_release_req -> cause = pCtbNtry -> nrmCs;
279
280 /* fill in CCBS request facility */
281 if( pCtbNtry -> CCBSstat EQ CCBSS_REQ )
282 {
283 CCD_START;
284 {
285 psaCC_asmCCBSReq( cId );
286 psaCC_asmComponent( cId );
287 }
288 CCD_END;
289
290 mncc_release_req -> fac_inf.l_fac = ssFIECodeBuf.l_buf;
291 mncc_release_req -> fac_inf.o_fac = 0;
292 memcpy (mncc_release_req->fac_inf.fac,
293 ssFIECodeBuf.buf + (ssFIECodeBuf.o_buf >> 3),
294 ssFIECodeBuf.l_buf >> 3);
295
296 mncc_release_req -> ss_version = SS_VERSION_3;
297 }
298 else
299 {
300 memset( &mncc_release_req -> fac_inf, 0, sizeof( T_fac_inf));
301 mncc_release_req -> ss_version = SS_VER_NOT_PRES;
302 }
303
304 PSENDX (CC, mncc_release_req);
305
306 psaCC_send_satevent( EVENT_CALL_DISC, cId, NEAR_END, TRUE );
307 }
308
309 /*
310 *-----------------------------------------------------------------
311 * relase call if in activate request state, network initiated
312 *-----------------------------------------------------------------
313 */
314 else if( pCtbNtry -> calStat EQ CS_ACT_REQ AND
315 pCtbNtry -> calType EQ CT_NI_MOC )
316 {
317 PALLOC (mncc_reject_req, MNCC_REJECT_REQ);
318
319 /* fill in primitive parameter: release request */
320 mncc_reject_req -> ti = pCtbNtry -> ti;
321 mncc_reject_req -> cause = pCtbNtry -> nrmCs;
322
323 PSENDX (CC, mncc_reject_req);
324
325 /* free call table entry */
326 psaCC_retMOCTi( pCtbNtry -> ti );
327
328 psaCC_FreeCtbNtry (cId);
329 }
330
331 /*
332 *-----------------------------------------------------------------
333 * disconnect all other calls
334 *-----------------------------------------------------------------
335 */
336 else
337 {
338 PALLOC (disc_req, MNCC_DISCONNECT_REQ); /* T_MNCC_DISCONNECT_REQ */
339 disc_req -> ti = pCtbNtry -> ti;
340 disc_req -> cause = pCtbNtry -> nrmCs;
341 if (pCtbNtry -> curCmd EQ AT_CMD_CTFR)
342 {
343 /* We expect here an already built facility in ssFIECodeBuf */
344 disc_req -> fac_inf.l_fac = ssFIECodeBuf.l_buf;
345 disc_req -> fac_inf.o_fac = 0;
346 memcpy (disc_req->fac_inf.fac,
347 ssFIECodeBuf.buf,
348 ssFIECodeBuf.l_buf >> 3);
349 disc_req -> ss_version = SS_VERSION_2;
350 }
351 else
352 {
353 disc_req -> fac_inf.l_fac = 0;
354 disc_req -> ss_version = SS_VER_NOT_PRES;
355 }
356 PSENDX (CC, disc_req);
357
358 /* update call status */
359 pCtbNtry -> calStat = CS_DSC_REQ;
360
361 /* monitoring for SAT */
362 psaCC_send_satevent( EVENT_CALL_DISC, cId , NEAR_END, TRUE );
363 }
364
365 /* Switch off audio path after user action (e.g. hangup) */
366 /* clb this breaks ACI056 (among others..) necessary ?? pCtbNtry -> inBndTns = FALSE; */
367 psaCC_setSpeechMode ();
368 }
369
370 /*
371 +-------------------------------------------------------------------+
372 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
373 | ROUTINE : psaCC_HoldCall |
374 +-------------------------------------------------------------------+
375
376 PURPOSE : put a call into hold state
377
378 */
379
380 GLOBAL void psaCC_HoldCall ( SHORT cId )
381 {
382 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
383
384 TRACE_FUNCTION ("psaCC_HoldCall()");
385
386 if (pCtbNtry EQ NULL)
387 return; /* Ensure not to dereference NULL */
388
389 /*
390 *-------------------------------------------------------------------
391 * create and send primitive
392 *-------------------------------------------------------------------
393 */
394 psaCC_StopDTMF ( cId );
395
396 {
397 PALLOC (mncc_hold_req, MNCC_HOLD_REQ);
398
399 /*
400 * fill in primitive parameter: hold request
401 */
402
403 mncc_hold_req -> ti = pCtbNtry -> ti;
404
405 PSENDX (CC, mncc_hold_req);
406
407 /* update call status */
408 pCtbNtry -> calStat = CS_HLD_REQ;
409
410 }
411 }
412
413 /*
414 +-------------------------------------------------------------------+
415 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
416 | ROUTINE : psaCC_RetrieveCall |
417 +-------------------------------------------------------------------+
418
419 PURPOSE : retrieve a held call
420
421 */
422
423 GLOBAL void psaCC_RetrieveCall ( SHORT cId )
424 {
425 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
426
427 TRACE_FUNCTION ("psaCC_RetrieveCall()");
428
429 /*
430 *-------------------------------------------------------------------
431 * create and send primitive
432 *-------------------------------------------------------------------
433 */
434 {
435 PALLOC (mncc_retrieve_req, MNCC_RETRIEVE_REQ);
436
437 /*
438 * fill in primitive parameter: retrieve request
439 */
440
441 mncc_retrieve_req -> ti = pCtbNtry -> ti;
442
443 PSENDX (CC, mncc_retrieve_req);
444
445 /*
446 * update call status ???
447 */
448 }
449 }
450
451 /*
452 +-------------------------------------------------------------------+
453 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
454 | ROUTINE : psaCC_ModifyCall |
455 +-------------------------------------------------------------------+
456
457 PURPOSE : modify an active call
458
459 */
460
461 GLOBAL SHORT psaCC_ModifyCall ( SHORT cId )
462 {
463 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
464 UBYTE nomBC; /* holds nominal bearer capabilities */
465
466 TRACE_FUNCTION ("psaCC_ModifyCall()");
467
468 if (pCtbNtry EQ NULL)
469 return -1;
470
471 /*
472 *-------------------------------------------------------------------
473 * check if call is in a active state
474 *-------------------------------------------------------------------
475 */
476 if(
477 (pCtbNtry -> calStat NEQ CS_ACT) AND
478 (pCtbNtry -> calStat NEQ CS_ACT_REQ)
479 )
480 return( -1 );
481 /*
482 *-------------------------------------------------------------------
483 * create and send primitive
484 *-------------------------------------------------------------------
485 */
486 psaCC_StopDTMF ( cId );
487 {
488 PALLOC (mncc_modify_req, MNCC_MODIFY_REQ);
489
490 /*
491 * fill in primitive parameter: modify request
492 */
493 nomBC = (pCtbNtry -> curBC)?0:1;
494
495 switch( pCtbNtry -> BC[nomBC].bearer_serv )
496 {
497 case( BEARER_SERV_AUX_SPEECH ):
498 case( BEARER_SERV_SPEECH ):
499 case( BEARER_SERV_AUX_SPEECH_CTM):
500 case( BEARER_SERV_SPEECH_CTM ):
501 mncc_modify_req -> serv = SERV_SPEECH;
502 break;
503
504 case( BEARER_SERV_FAX ):
505 case( BEARER_SERV_ASYNC ):
506 case( BEARER_SERV_SYNC ):
507 case( BEARER_SERV_PAD_ACCESS ):
508 case( BEARER_SERV_PACKET_ACCESS ):
509 mncc_modify_req -> serv = SERV_DATA;
510
511 /* check for TTY service */
512 cmhCC_TTY_Control ( cId, TTY_PAUSE );
513 break;
514
515 default:
516 mncc_modify_req -> serv = SERV_NOT_PRES;
517 }
518 mncc_modify_req -> ti = pCtbNtry -> ti;
519
520 PSENDX (CC, mncc_modify_req);
521
522 /*
523 * update call status
524 */
525 pCtbNtry -> calStat = CS_MDF_REQ;
526 }
527 return 0;
528 }
529
530 /*
531 +-------------------------------------------------------------------+
532 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
533 | ROUTINE : psaCC_SendDTMF |
534 +-------------------------------------------------------------------+
535
536 PURPOSE : send DTMF tones
537
538 */
539
540 GLOBAL SHORT psaCC_SendDTMF ( SHORT cId,
541 UBYTE digit,
542 UBYTE mode )
543 {
544
545 TRACE_FUNCTION ("psaCC_SendDTMF()");
546
547 if (ccShrdPrm.ctb[cId] EQ NULL)
548 return -1; /* Ensure not to dereference NULL */
549
550 /*
551 *-------------------------------------------------------------------
552 * create and send primitive
553 *-------------------------------------------------------------------
554 */
555 {
556 PALLOC (mncc_start_dtmf_req, MNCC_START_DTMF_REQ);
557
558 /*
559 * fill in primitive parameter: DTMF tone request
560 */
561
562 mncc_start_dtmf_req -> ti = psaCC_ctb(cId)->ti;
563 mncc_start_dtmf_req -> key = digit;
564 mncc_start_dtmf_req -> dtmf_mod = mode;
565
566 PSENDX (CC, mncc_start_dtmf_req);
567 }
568
569 return 0;
570 }
571
572 /*
573 +-------------------------------------------------------------------+
574 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
575 | ROUTINE : psaCC_Config |
576 +-------------------------------------------------------------------+
577 PURPOSE : configure CC entity
578 */
579
580 GLOBAL void psaCC_Config ( void )
581 {
582 T_bcpara *mtcBC;
583
584 TRACE_FUNCTION ("psaCC_Config()");
585
586 /* create and send primitive */
587 {
588 PALLOC (mncc_configure_req, MNCC_CONFIGURE_REQ);
589
590 /* fill in primitive parameter: configure request */
591 memset(&(mncc_configure_req -> called_party_sub), 0,
592 sizeof(T_called_party_sub));
593
594 /* MTC bearer caps */
595 mtcBC = &mncc_configure_req -> bcpara;
596 mtcBC->rate = cmhCC_SelRate( ccShrdPrm.CBSTspeed );
597
598 if( ccShrdPrm.snsMode EQ CSNS_MOD_Fax OR
599 ccShrdPrm.snsMode EQ CSNS_MOD_VAFVoice OR
600 ccShrdPrm.snsMode EQ CSNS_MOD_VAFFax )
601 {
602 mtcBC->bearer_serv = BEARER_SERV_FAX;
603 mtcBC->modem_type = MT_NONE;
604 mtcBC->conn_elem = CONN_ELEM_TRANS;
605 }
606 else
607 {
608 mtcBC->bearer_serv = cmhCC_SelServ( ccShrdPrm.CBSTname );
609 mtcBC->modem_type = cmhCC_SelMT ( ccShrdPrm.CBSTspeed );
610 mtcBC->conn_elem = cmhCC_SelCE ( ccShrdPrm.CBSTce );
611 }
612
613 /* not sure whether this is taken into account by CC */
614 mtcBC->stop_bits = DEF_BC1_SB; /*cmhCC_SelStopBit( srcId );*/
615 mtcBC->data_bits = DEF_BC1_DB; /*cmhCC_SelDataBit( srcId );*/
616 mtcBC->parity = DEF_BC1_PR; /*cmhCC_SelParity ( srcId );*/
617 mtcBC->flow_control = DEF_BC1_FC;
618 /*****************************************************/
619
620 /* mncc_configure_req -> bcpara = *mtcBC; superfluous */
621 mncc_configure_req -> sns_mode = ccShrdPrm.snsMode;
622 #ifdef FF_TTY
623 mncc_configure_req -> ctm_ena = ccShrdPrm.ctmReq;
624 #else
625 mncc_configure_req -> ctm_ena = CTM_DISABLED;
626 #endif /* FF_TTY */
627 PSENDX (CC, mncc_configure_req);
628 }
629 }
630
631 /*
632 +-------------------------------------------------------------------+
633 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
634 | ROUTINE : psaCC_SendSS |
635 +-------------------------------------------------------------------+
636
637 PURPOSE : send SS facility
638
639 */
640
641 LOCAL SHORT psaCC_SendSS ( SHORT cId )
642 {
643 T_CC_CALL_TBL *pCtbNtry = ccShrdPrm.ctb[cId];
644 UBYTE ccdRet; /* holds CCD return value */
645
646 TRACE_FUNCTION ("psaCC_SendSS()");
647
648 if (pCtbNtry EQ NULL)
649 return -1; /* Ensure not to dereference NULL */
650
651 /*
652 *-------------------------------------------------------------------
653 * create and send primitive
654 *-------------------------------------------------------------------
655 */
656 {
657 PALLOC (mncc_facility_req, MNCC_FACILITY_REQ);
658
659 /*
660 * fill in primitive parameter: facility request
661 */
662
663 mncc_facility_req -> ti = pCtbNtry -> ti;
664 mncc_facility_req -> ss_version = pCtbNtry -> SSver;
665
666 CCD_START;
667 {
668 MCAST( com, COMPONENT );
669
670 memset( com, 0, sizeof( T_COMPONENT ));
671 switch( ccShrdPrm.cmpType )
672 {
673 case( CT_INV ):
674 com -> v_inv_comp = TRUE;
675 com -> inv_comp.v_inv_id = TRUE;
676 com -> inv_comp.inv_id = pCtbNtry -> iId
677 = ccShrdPrm.iIdNxt++;
678 com -> inv_comp.v_op_code = TRUE;
679 com -> inv_comp.op_code = pCtbNtry -> opCode
680 = ssFIECodeBuf.buf[0];
681 com -> inv_comp.v_params = TRUE;
682 com -> inv_comp.params.l_params = ssFIECodeBuf.l_buf-8;
683 com -> inv_comp.params.o_params = 8;
684 memcpy( com -> inv_comp.params.b_params,
685 ssFIECodeBuf.buf, ssFIECodeBuf.l_buf );
686 break;
687 case( CT_RET_RSLT ):
688 break;
689 case( CT_RET_ERR ):
690 break;
691 case( CT_RET_REJ ):
692 break;
693 }
694 mncc_facility_req -> fac_inf.l_fac = FACILITY_LEN<<3;
695 mncc_facility_req -> fac_inf.o_fac = 0;
696 ccdRet = ccd_codeMsg (CCDENT_FAC,
697 UPLINK,
698 (T_MSGBUF *) &mncc_facility_req -> fac_inf,
699 (UBYTE *) _decodedMsg,
700 COMPONENT);
701
702 if( ccdRet NEQ ccdOK )
703 {
704 TRACE_EVENT_P1( "CCD Coding Error: %d",ccdRet );
705 PFREE( mncc_facility_req );
706 CCD_END;
707 return( -1 );
708 }
709 }
710 CCD_END;
711
712 pCtbNtry -> srvType = ST_MOS;
713
714 psaCC_DumpFIE ( &mncc_facility_req -> fac_inf );
715 cmhCC_sendFie ( CSCN_FACILITY_DIRECTION_OUT,
716 cId,
717 &mncc_facility_req -> fac_inf );
718
719 PSENDX (CC, mncc_facility_req);
720 }
721
722 return 0;
723 }
724
725 /*
726 +-------------------------------------------------------------------+
727 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
728 | ROUTINE : psaCC_BuildMPTY |
729 +-------------------------------------------------------------------+
730
731 PURPOSE : build multiparty
732
733 */
734
735 GLOBAL void psaCC_BuildMPTY ( SHORT cId )
736 {
737 SHORT ctbIdx; /* holds call table index */
738
739 TRACE_FUNCTION ("psaCC_BuildMPTY()");
740
741 /*
742 *-------------------------------------------------------------------
743 * set multiparty status for held calls
744 *-------------------------------------------------------------------
745 */
746 for( ctbIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ )
747 {
748 if (ccShrdPrm.ctb[ctbIdx] NEQ NULL AND
749 psaCC_ctb(ctbIdx)->calStat EQ CS_HLD )
750 {
751 if( psaCC_ctb(ctbIdx)->mptyStat NEQ CS_ACT )
752
753 psaCC_ctb(ctbIdx)->mptyStat = CS_ACT_REQ;
754 }
755 }
756
757 /* set multiparty status for active call */
758 if( psaCC_ctb(cId)->mptyStat NEQ CS_ACT )
759 psaCC_ctb(cId)->mptyStat = CS_ACT_REQ;
760
761 /*
762 *-------------------------------------------------------------------
763 * send facility information element
764 *-------------------------------------------------------------------
765 */
766 psaCC_asmBuildMPTY();
767
768 if( psaCC_SendSS(cId) EQ 0 )
769 {
770 ccShrdPrm.cIdMPTY = cId;
771 TIMERSTART( TMPTY_VALUE, ACI_TMPTY );
772 }
773
774 psaCC_MPTY (cId, MPTY_BUILD_SENT);
775 }
776
777 /*
778 +-------------------------------------------------------------------+
779 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
780 | ROUTINE : psaCC_HoldMPTY |
781 +-------------------------------------------------------------------+
782
783 PURPOSE : hold multiparty
784
785 */
786
787 GLOBAL void psaCC_HoldMPTY ( SHORT cId )
788 {
789 SHORT ctbIdx; /* holds call table index */
790
791 TRACE_FUNCTION ("psaCC_HoldMPTY()");
792
793 /*
794 *-------------------------------------------------------------------
795 * set call status for multiparty members
796 *-------------------------------------------------------------------
797 */
798 for( ctbIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ )
799 {
800 if (ccShrdPrm.ctb[ctbIdx] NEQ NULL AND
801 psaCC_ctb(ctbIdx)->calStat EQ CS_ACT AND
802 psaCC_ctb(ctbIdx)->mptyStat EQ CS_ACT)
803 {
804 psaCC_ctb(ctbIdx)->calStat = CS_HLD_REQ;
805 }
806 }
807
808 /* set multiparty status for active call */
809 psaCC_ctb(cId)->calStat = CS_HLD_REQ;
810
811 /*
812 *-------------------------------------------------------------------
813 * send facility information element
814 *-------------------------------------------------------------------
815 */
816 psaCC_asmHoldMPTY();
817
818 if( psaCC_SendSS(cId) EQ 0 )
819 {
820 ccShrdPrm.cIdMPTY = cId;
821 TIMERSTART( TMPTY_VALUE, ACI_TMPTY );
822 }
823
824 psaCC_MPTY (cId, MPTY_HOLD_SENT);
825 }
826
827 /*
828 +-------------------------------------------------------------------+
829 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
830 | ROUTINE : psaCC_RetrieveMPTY |
831 +-------------------------------------------------------------------+
832
833 PURPOSE : retrieve multiparty
834
835 */
836
837 GLOBAL void psaCC_RetrieveMPTY ( SHORT cId )
838 {
839 SHORT ctbIdx; /* holds call table index */
840
841 TRACE_FUNCTION ("psaCC_RetrieveMPTY()");
842
843 /*
844 *-------------------------------------------------------------------
845 * set call status for multiparty members
846 *-------------------------------------------------------------------
847 */
848 for( ctbIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ )
849 {
850 if (ccShrdPrm.ctb[ctbIdx] NEQ NULL AND
851 psaCC_ctb(ctbIdx)->calStat EQ CS_HLD AND
852 psaCC_ctb(ctbIdx)->mptyStat EQ CS_ACT)
853 {
854 psaCC_ctb(ctbIdx)->calStat = CS_ACT_REQ;
855 }
856 }
857
858 /* set multiparty status for active call */
859 psaCC_ctb(cId)->calStat = CS_ACT_REQ;
860
861 /*
862 *-------------------------------------------------------------------
863 * send facility information element
864 *-------------------------------------------------------------------
865 */
866 psaCC_asmRetrieveMPTY();
867
868 if( psaCC_SendSS(cId) EQ 0 )
869 {
870 ccShrdPrm.cIdMPTY = cId;
871 TIMERSTART( TMPTY_VALUE, ACI_TMPTY );
872 }
873
874 psaCC_MPTY (cId, MPTY_RETRIEVE_SENT);
875
876 return;
877 }
878
879
880
881 /*
882 +-------------------------------------------------------------------+
883 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
884 | ROUTINE : psaCC_CountMPTY |
885 +-------------------------------------------------------------------+
886
887 PURPOSE : counts the number of parties in a MPTY
888
889 */
890
891 GLOBAL int psaCC_CountMPTY ( void )
892 {
893 int i = 0;
894 SHORT cId;
895 TRACE_FUNCTION ("psaCC_CountMPTY()");
896
897 for( cId = 0; cId < MAX_CALL_NR; cId++ )
898 {
899 if (ccShrdPrm.ctb[cId] NEQ NULL AND
900 psaCC_ctb(cId)->mptyStat EQ CS_ACT)
901 {
902 i++;
903 }
904 }
905 return i;
906 }
907
908
909
910 /*
911 +-------------------------------------------------------------------+
912 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
913 | ROUTINE : psaCC_SplitMPTY |
914 +-------------------------------------------------------------------+
915
916 PURPOSE : split multiparty
917
918 */
919
920 GLOBAL void psaCC_SplitMPTY ( SHORT cId )
921 {
922 TRACE_FUNCTION ("psaCC_SplitMPTY()");
923
924 /* set multiparty status for active call */
925 psaCC_ctb(cId)->mptyStat = CS_DSC_REQ;
926
927 /*
928 *-------------------------------------------------------------------
929 * send facility information element
930 *-------------------------------------------------------------------
931 */
932 psaCC_asmSplitMPTY();
933
934 if( psaCC_SendSS(cId) EQ 0 )
935 {
936 ccShrdPrm.cIdMPTY = cId;
937 TIMERSTART( TMPTY_VALUE, ACI_TMPTY );
938 }
939
940 psaCC_MPTY (cId, MPTY_SPLIT_SENT);
941 }
942
943 /*
944 +-------------------------------------------------------------------+
945 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
946 | ROUTINE : psaCC_ECT |
947 +-------------------------------------------------------------------+
948
949 PURPOSE : explicit call transfer
950
951 */
952
953 GLOBAL SHORT psaCC_ECT ( SHORT cId )
954 {
955 SHORT psa_ret;
956
957 TRACE_FUNCTION ("psaCC_ECT()");
958
959 /*
960 *-------------------------------------------------------------------
961 * send facility information element
962 *-------------------------------------------------------------------
963 */
964 psaCC_asmECT();
965
966 psa_ret = psaCC_SendSS(cId);
967
968 if( psa_ret EQ 0 )
969 {
970 TIMERSTART( TECT_VALUE, ACI_TECT );
971 }
972
973 return(psa_ret);
974 }
975
976 #if 0 /* HM 3-May-2005: This function is not used, but it's still planned for some day */
977 /*
978 +-------------------------------------------------------------------+
979 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
980 | ROUTINE : psaCC_BCapCode |
981 +-------------------------------------------------------------------+
982
983 PURPOSE : code bearer capabilites according GSM 04.08
984
985 */
986
987 GLOBAL SHORT psaCC_BCapCode ( UBYTE reqId, SHORT cId, UBYTE bc )
988 {
989 TRACE_FUNCTION ("psaCC_BCapCode()");
990
991 /*
992 *-------------------------------------------------------------------
993 * create and send primitive
994 *-------------------------------------------------------------------
995 */
996 {
997 PALLOC (mncc_bearer_cap_req, MNCC_BEARER_CAP_REQ);
998
999 /*
1000 * fill in primitive parameter: bearer capability coding request
1001 */
1002 mncc_bearer_cap_req -> req_id = reqId;
1003 mncc_bearer_cap_req -> bc_mod = BC_MOD_CODE;
1004 mncc_bearer_cap_req -> bcpara = psaCC_ctb(cId)->BC[bc];
1005
1006 PSENDX (CC, mncc_bearer_cap_req);
1007 }
1008
1009 return 0;
1010 }
1011 #endif /* #if 0 */
1012
1013 #if 0 /* HM 3-May-2005: This function is not used, but it's still planned for some day */
1014 /*
1015 +-------------------------------------------------------------------+
1016 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
1017 | ROUTINE : psaCC_BCapDecode |
1018 +-------------------------------------------------------------------+
1019
1020 PURPOSE : decode bearer cpabilities according GSM 04.08 into struct
1021 bcpara.
1022
1023 */
1024
1025 GLOBAL SHORT psaCC_BCapDecode ( UBYTE reqId, UBYTE bcLen, UBYTE *bc )
1026 {
1027 TRACE_FUNCTION ("psaCC_BCapDecode()");
1028
1029 /*
1030 *-------------------------------------------------------------------
1031 * create and send primitive
1032 *-------------------------------------------------------------------
1033 */
1034 if( bcLen > MAX_BC_LEN ) return -1;
1035
1036 {
1037 PALLOC (mncc_bearer_cap_req, MNCC_BEARER_CAP_REQ);
1038
1039 /*
1040 * fill in primitive parameter: bearer capability decoding request
1041 */
1042 mncc_bearer_cap_req -> req_id = reqId;
1043 mncc_bearer_cap_req -> bc_mod = BC_MOD_DECODE;
1044 mncc_bearer_cap_req -> bcconf.bc_len = bcLen;
1045
1046 memcpy( mncc_bearer_cap_req -> bcconf.bc, bc, bcLen );
1047
1048 PSENDX (CC, mncc_bearer_cap_req);
1049 }
1050
1051 return 0;
1052 }
1053 #endif /* #if 0 */
1054
1055
1056 /*
1057 +-------------------------------------------------------------------+
1058 | PROJECT : GSM-PS (6147) MODULE : PSA_CCS |
1059 | ROUTINE : psaCC_MPTY |
1060 +-------------------------------------------------------------------+
1061
1062 PURPOSE : Inform CC about an event related to a multiparty call
1063 which may change the auxiliary state hold or mpty in CC.
1064
1065 */
1066
1067 GLOBAL SHORT psaCC_MPTY ( SHORT cId, UBYTE mpty_event )
1068 {
1069 TRACE_FUNCTION ("psaCC_MPTY()");
1070
1071 /* Send the synchronization request to CC */
1072 {
1073 PALLOC (mncc_sync_req, MNCC_SYNC_REQ); /* T_MNCC_SYNC_REQ */
1074 mncc_sync_req->synccs = SYNCCS_MPTY_EVENT;
1075 mncc_sync_req->ti = psaCC_ctb(cId)->ti;
1076 mncc_sync_req->mpty_event = mpty_event;
1077 PSENDX (CC, mncc_sync_req);
1078 }
1079 return 0;
1080 }
1081
1082 /*==== EOF ========================================================*/
1083