Call a Skype user in a html page

Introduction to html-based Skype interaction

When the user has installed Skype, one can open Skype directly from a webpage. The protocol is skype:skypename – and optional flags.

The example will use the chinese demo user of Skype (echo-chinese) – which will record a call and play it back or ping back the typed in chat messages.

Call a skype user

The optional flag is call – to force Skype to call somebody. It can also be left out – but if the user changed the default behaviour to e.g. chat – Skype will open an IM session instead. So – go the save way and use the call – flag.

EXAMPLE: CALL A SKYPE USER

call echo-chinese with Skype
<a href="skype:echo-chinese?call">call echo-chinese with Skype</a>

Send an Skype IM message to a Skype user

The optional flag is chat. See the example below to see the usage in a html page.

EXAMPLE: SEND A CHAT MESSAGE TO A SKYPE USER

<a href="skype:echo-chinese?chat">Chat with echo-chinese</a>

Send a voicemail to a Skype user

The optional flag is voicemail – as you might have guessed.

EXAMPLE: SEND A VOICEMAIL TO SKYPE USER

<a href="skype:echo-chinese?voicemail">Send voicemail to echo-chinese</a>

Create a Skype conference call with multiple users

This is as easy as the examples above – just more usernames before the “?” and call as flag.

EXAMPLE: CREATE A SKYPE CONFERENCE CALL

<a href="skype:echo-chinese;echo123?call">conference call with echo-chinese and echo123</a>

Create a conference chat with multiple users

Same as conference call – with chat as flag.

EXAMPLE: OPEN A CONFERENCE CHAT WITH MULTIPLE USERS – IN HTML

<a href="skype:echo-chinese;echo123?chat">conference chat with echo-chinese and echo123</a>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这个错误是因为在常量表达式中使用了函数调用。在C++中,常量表达式必须在编译时求值,而函数调用需要在运行时才能执行。因此,函数调用不能用于常量表达式。要解决这个问题,可以将函数调用替换为常量或表达式。 ### 回答2: 在C++中,常量表达式是指编译时可以确定并在程序整个生命周期里都不会改变的表达式。在这种情况下,编译器会在编译时计算表达式的值,并将它放入程序的常量中。 如果在常量表达式中使用了函数调用,就会出现错误“function call is not allowed in a constant expression”。这是因为函数调用的结果无法在编译时确定。比如,如果在常量表达式中调用time函数,它的返回值是当前的系统时间,不可能在程序编译时确定。 另外,像动态内存分配、多态、异常处理等和运行时相关的操作也不能在常量表达式中使用。 如果需要在常量表达式中使用某个函数的返回值,可以考虑将函数转换为constexpr函数。constexpr函数是指可以在编译时计算的函数,可以用于常量表达式中。要让函数成为constexpr函数,它必须满足一定的条件,比如函数体必须是一个单一的return语句,函数参数和返回值类型都必须是字面类型等等。 总之,在C++中,常量表达式是很有用的东西,可以用于各种场合,比如声明数组大小、哈希表大小等等。但是需要注意的是,表达式中不能包含运行时相关的操作,比如函数调用和动态内存分配等。 ### 回答3: 在C++语言中,常量表达式是指编译时能够被计算出结果的表达式。这种表达式在编译期间就已经确定了值,因为它们不需要等到程序运行时才计算。 而如果在常量表达式里使用了函数调用,就会出现“function call is not allowed in a constant expression”的错误提示。这是因为函数的运行需要在程序运行时才能被计算出结果,而编译器在编译时并不知道函数运行后的结果。 例如,在以下代码中,我们定义了一个常量表达式,并在其中调用了sqrt函数: const double r = 5.0; const double PI = 3.14159; const double area = PI * sqrt(r); // 出错:function call is not allowed in a constant expression sqrt函数在运行时需要进行计算,因此不能用在常量表达式中。如果想要在常量表达式中使用sqrt函数,需要使用编译时计算替代函数调用。例如,我们可以手动计算出sqrt(r)的值,然后在常量表达式中使用这个值: const double r = 5.0; const double PI = 3.14159; const double sqrt_r = 2.236; const double area = PI * sqrt_r; // 正确,sqrt_r是编译时常量 在编写常量表达式时,需要注意避免使用函数调用、动态内存分配、非constexpr变量和语句(如if、for等)。只有在常量表达式中使用编译时常量才是安全有效的做法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值