This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
sdk:scripts:voice-dispatcher-audio [2015/05/05 15:04] – external edit 127.0.0.1 | sdk:scripts:voice-dispatcher-audio [2020/03/18 09:47] – fachet | ||
---|---|---|---|
Line 2: | Line 2: | ||
<code c voice-dispatcher-audio.are> | <code c voice-dispatcher-audio.are> | ||
/* DESC: This script implements an audio voice dispatcher | /* DESC: This script implements an audio voice dispatcher | ||
+ | * The first audio Interface (line-in/ | ||
+ | * - Dialing os controlled via digital in 1 (in1) | ||
+ | | ||
+ | | ||
+ | | ||
+ | * - Incomming calls are signaled at digital out 1 (out1). | ||
+ | | ||
+ | | ||
+ | * | ||
* Copyright (C) 2012 NetModule AG, Switzerland | * Copyright (C) 2012 NetModule AG, Switzerland | ||
+ | | ||
*/ | */ | ||
- | INTERVAL = 3; / | + | INTERVAL = 1; / |
NUMBER = " | NUMBER = " | ||
Line 83: | Line 93: | ||
nb_syslog(" | nb_syslog(" | ||
} | } | ||
+ | nb_dio_set(" | ||
} else { | } else { | ||
nb_syslog(" | nb_syslog(" | ||
Line 99: | Line 110: | ||
} | } | ||
} | } | ||
+ | nb_dio_set(" | ||
} | } | ||
Line 132: | Line 144: | ||
if (nb_voice_call_route(call, | if (nb_voice_call_route(call, | ||
nb_syslog(" | nb_syslog(" | ||
+ | nb_dio_set(" | ||
} else { | } else { | ||
nb_syslog(" | nb_syslog(" | ||
nb_voice_call_hangup(call); | nb_voice_call_hangup(call); | ||
+ | nb_dio_set(" | ||
} | } | ||
break; | break; | ||
Line 146: | Line 160: | ||
if (austate == " | if (austate == " | ||
nb_syslog(" | nb_syslog(" | ||
- | nb_voice_call_hangup(call); | ||
} else { | } else { | ||
/* wait until IN1 has been closed */ | /* wait until IN1 has been closed */ | ||
Line 157: | Line 170: | ||
if (nb_voice_call_accept(call) == 0) { | if (nb_voice_call_accept(call) == 0) { | ||
nb_syslog(" | nb_syslog(" | ||
- | + | | |
- | if (1) { | + | return; |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | return; | + | |
} else { | } else { | ||
nb_syslog(" | nb_syslog(" | ||
Line 175: | Line 183: | ||
nb_syslog(" | nb_syslog(" | ||
nb_voice_call_hangup(call); | nb_voice_call_hangup(call); | ||
+ | nb_dio_set(" | ||
} | } | ||
break; | break; | ||
Line 200: | Line 209: | ||
d = new dispatcher(); | d = new dispatcher(); | ||
+ | nb_dio_set(" | ||
dump(d); | dump(d); | ||
d.run(); | d.run(); |