Sat Apr 26 2014 22:03:05

Asterisk developer's documentation


pktccops.h File Reference

PacketCable COPS. More...

Include dependency graph for pktccops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cops_gate

Enumerations

enum  { GATE_SET, GATE_INFO, GATE_SET_HAVE_GATEID, GATE_DEL }
enum  {
  GATE_ALLOC_FAILED, GATE_ALLOC_PROGRESS, GATE_ALLOCATED, GATE_CLOSED,
  GATE_CLOSED_ERR, GATE_OPEN, GATE_DELETED, GATE_TIMEOUT
}

Functions

struct cops_gateast_pktccops_gate_alloc (int cmd, struct cops_gate *gate, uint32_t mta, uint32_t actcount, float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport, int(*const got_dq_gi)(struct cops_gate *gate), int(*const gate_remove)(struct cops_gate *gate))

Detailed Description

PacketCable COPS.

Author:
Attila Domjan <attila.domjan.hu@gmail.com>

Definition in file pktccops.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
GATE_SET 
GATE_INFO 
GATE_SET_HAVE_GATEID 
GATE_DEL 

Definition at line 35 of file pktccops.h.

anonymous enum
Enumerator:
GATE_ALLOC_FAILED 
GATE_ALLOC_PROGRESS 
GATE_ALLOCATED 
GATE_CLOSED 
GATE_CLOSED_ERR 
GATE_OPEN 
GATE_DELETED 
GATE_TIMEOUT 

Definition at line 42 of file pktccops.h.


Function Documentation

struct cops_gate* ast_pktccops_gate_alloc ( int  cmd,
struct cops_gate gate,
uint32_t  mta,
uint32_t  actcount,
float  bitrate,
uint32_t  psize,
uint32_t  ssip,
uint16_t  ssport,
int(*)(struct cops_gate *gate)  got_dq_gi,
int(*)(struct cops_gate *gate)  gate_remove 
) [read]

Definition at line 470 of file res_pktccops.c.

References ast_debug, ast_log(), cops_gate_cmd(), cops_gate::gate_remove, GATE_SET_HAVE_GATEID, cops_gate::gateid, cops_gate::got_dq_gi, LOG_WARNING, and pktcreload.

Referenced by mgcp_alloc_pktcgate(), and mgcp_hangup().

{
   while (pktcreload) {
      sched_yield();
   }

   if (cmd == GATE_SET_HAVE_GATEID && gate) {
      ast_debug(3, "------- gate modify gateid 0x%x ssip: 0x%x\n", gate->gateid, ssip);
      /* TODO implement it */
      ast_log(LOG_WARNING, "Modify GateID not implemented\n");
   } 
   
   if ((gate = cops_gate_cmd(cmd, NULL, cops_trid++, mta, actcount, bitrate, psize, ssip, ssport, gate))) {
      ast_debug(3, "COPS: Allocating gate for mta: 0x%x\n", mta);
      gate->got_dq_gi = got_dq_gi;
      gate->gate_remove = gate_remove;
      return(gate);
   } else {
      ast_debug(3, "COPS: Couldn't allocate gate for mta: 0x%x\n", mta); 
      return NULL;
   }
}