cpprestsdk实现通过阿里云拨打电话(语音通知)

本文介绍了如何利用cpprestsdk库与阿里云接口交互,实现通过RESTful API进行语音通知的功能,详细阐述了cpprestsdk的使用方法和阿里云语音服务的集成过程。
摘要由CSDN通过智能技术生成

下面

srand(time(0));//初始化的时候使用

static char dec2hex(short int c)
{
    if (0 <= c && c <= 9)
    {
        return c + '0';
    }
    else if (10 <= c && c <= 15)
    {
        return c + 'A' - 10;
    }
    else
    {
        return -1;
    }
}

static char* change(char* str)
{
//    assert(str != NULL);//断言,判断str知否指向空
    char* pstr = str;//由于str要进行变化,以后还要用到,所以先把他用pstr存起来
    int space_count = 0;//计数器
    char* end = NULL;
    char* end_new = NULL;
    while(*str++!='\0')
    {
        if(*str == '+' || *str == '*')
            space_count++;//进行空格计数
        else if(*str == '~')
            space_count--;
    }
    end = str;
    end_new = end + 2*space_count;
    str = pstr;
    while(end != end_new)//当新结束指针和原结束指针不相等时
    {
        if(*end == '+')
        {
            *end_new-- = '0';
            *end_new-- = '2';
            *end_new-- = '%';
            end--;
        }
        else if(*end == '*')
        {
            *end_new-- = 'A';
            *end_new-- = '2';
            *end_new-- 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值