asterisk中常用函式說明

2021-09-01 14:25:51 字數 2157 閱讀 8598

int ast_strlen_zero(const char *s);

\param s    判斷的字串

s為空返回1,非空返回0

int ast_play_and_wait(struct ast_channel *chan, const char *fn);

return     返回按的鍵,只能有乙個鍵

int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang);

int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders);

\param c                讀取資料的通道

\param s                讀取的字串存入s,需要有空間

\param len            最多能讀取字元的長度

\param timeout    字元輸入之間間隔容許的最長時間

\param ftimeout    等待第乙個字元的最長時間

\param enders        輸入字串結束標誌

從c中讀取輸入的資料,並儲存在s中,最大儲存資料為len,兩個資料之間最大時間間隔為timeout,等待第乙個字元的最長時間為ftimeout,當輸入enders時表示輸入結束

正常讀取資料返回0,超過timeout返回1,失敗返回-1

int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options);

\param    options    "f"為女性的,"m"為男性,"c"為親切的,"n"為中立的,"p"為復性的

struct ast_variable *ast_load_realtime(const char *family, ...);

\param    family    為連線資料庫的控制代碼,在/etc/asterisk/extconfig.conf內設定

\param    ...            變參,傳入方式為"字段","與此字段相應的數值","字段","與此字段相應的數值", ...最後是null結尾

返回在family連線的表中符合...的內容,若有相符的,返回乙個struct ast_variable的結構體,沒有則返回null

我們可以簡化struct ast_variable ;(實際上在**中並不是這樣子的,為了方便看懂才寫成這樣)

void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value);

\param    chan    設定的變數所在的通道

\param    name    設定的變數名

\param    value    變數的值

在chan中設定變數名為name,值為value的變數

const char *pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name);

\param    chan    取得變數的通道

\param    name    變數的名字

得到在chan通道中變數名為name的變數值,返回name的值,這個函式都是通過

void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value);

先設定name的值,再用此函式得到這個值

int ast_ivr_menu_run(struct ast_channel *c, struct ast_ivr_menu *menu, void *cbdata);

\param    c            執行的渠道        

\param    menu    執行的乙個struct ast_ivr_menu變數

\param    cbdata    傳入menu內的引數

執行menu,成功返回0,結束通話返回-1,menu有錯返回-2

Mysql JDBC URL 中常用引數說明

對應中文環境,通常mysql連線url可以設定為 jdbc mysql localhost 3306 test?user root password useunicode true characterencoding gbk autoreconnect true failoverreadonly f...

Makefile 常用函式說明

function arguments 譯作 函式名 引數列表 makefile字串函式 1.subst 說明 字元替換函式,將字串text中的from字元,完全替換成to。語法 subst from,to,text 示例 subst from ee,ee,feet on the street 結果 ...

Arduino 常用函式說明

pinmode pin,mode 引數 pin 引腳號 mode input output digitalwrite pin,value 引數 pin 引腳號 value high low int digitalread pin 引數 pin 引腳號 返回值 int 1 0 int analogre...