Browse Source

teste agi_c

remotes/origin/master
Rodgger 2 years ago
parent
commit
c6ff4b511b
  1. 36
      agi.c

36
agi.c

@ -38,7 +38,34 @@ int ast_agi_add_param( s_agi_parameter **ast_root, s_agi_parameter *ast_next ){
return 0;
}
/*
agi_request The filename of your script
agi_channel The originating channel (your phone)
agi_language The language code (e.g. en)
agi_type The originating channel type (e.g. SIP or ZAP)
agi_uniqueid A unique ID for the call
agi_version The version of Asterisk (since Asterisk 1.6)
agi_callerid The caller ID number (or unknown)
agi_calleridname The caller ID name (or unknown)
agi_callingpres The presentation for the callerid in a ZAP channel
agi_callingani2 The number which is defined in ANI2 see Asterisk Detailed Variable List (only for PRI Channels)
agi_callington The type of number used in PRI Channels see Asterisk Detailed Variable List
agi_callingtns An optional 4 digit number (Transit Network Selector) used in PRI Channels see Asterisk Detailed Variable List
agi_dnid The dialed number id (or unknown)
agi_rdnis The referring DNIS number (or unknown)
agi_context Origin context in extensions.conf
agi_extension The called number
agi_priority The priority it was executed as in the dial plan
agi_enhanced The flag value is 1.0 if started as an EAGI script, 0.0 otherwise
agi_accountcode Account code of the origin channel
agi_threadid Thread ID of the AGI script (since Asterisk 1.6)
agi_arg_1
agi_arg_2
.
.
.
agi_arg_127
*/
// chamar o agi e receber parametros
s_agi_parameter *ast_agi( ){
@ -53,13 +80,12 @@ s_agi_parameter *ast_agi( ){
n = ast_agi_key( &next_ast_param->key, line );
if(n < 1){
printf("VERBOSE \"erro key line=%s\"\n", line);
return NULL;
}
n = ast_agi_value( &next_ast_param->value, &line[n + 2] );
if(n < 1){
next_ast_param->value = NULL;
next_ast_param->value = NULL; // valor NULL da key
}
ast_agi_add_param( &ast_param, next_ast_param );
@ -160,6 +186,10 @@ int agi_verbose_all_param(s_agi_parameter *param){
snprintf( str, 300, "DEBUG - %s: |%s|", (param->key == NULL ? "NULL" : param->key), (param->value == NULL ? "NULL" : param->value ) );
printf("VERBOSE \"%s\" \n", str);
char p[200];
ast_agi_stdin( p, 200 );
printf("VERBOSE \"%s\"\n", p);
ast_agi_stdin( p, 200 );
param = param->next;
}

Loading…
Cancel
Save