feat: add call echo to line function.
This commit is contained in:
parent
b16aea5b1d
commit
13dc27c4e0
|
@ -35,5 +35,9 @@ class FreeswitchClient:
|
|||
def uptime(self):
|
||||
return self._apiCommand('uptime')
|
||||
|
||||
def call_echo_to_line(self, line, did_name='echo', did_number='0234'):
|
||||
user = 'user/' + str(line)
|
||||
return self._apiCommand(' '.join(['originate', user, '&echo()', 'nose', 'XML', did_name, did_number]))
|
||||
|
||||
def close(self):
|
||||
self.client.close()
|
||||
|
|
22
README.md
22
README.md
|
@ -1,11 +1,33 @@
|
|||
# README
|
||||
Estudio: Librería para jugar con Freeswitch.
|
||||
|
||||
## Detalles del protocolo de Freeswitch
|
||||
|
||||
+ 2 saltos de linea separan el envio del comando y la respuesta recibida.
|
||||
+ Al conectarse al servidor se recibe: "Content-Type: auth/request"
|
||||
+ comando para autenticarse: "auth"
|
||||
+ respuesta de autenticacion correcta: "Content-Type: command/reply\nReply-Text: +OK accepted"
|
||||
|
||||
### Documentacion defree switch api
|
||||
https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_commands_1966741/
|
||||
|
||||
#### convencion de la documentacion
|
||||
+ <> indica que el parámetro es obligatorio
|
||||
+ | sindica ó o ór
|
||||
+ [] opcional
|
||||
|
||||
## Ejercicios
|
||||
|
||||
### 2023-07-15
|
||||
```
|
||||
api originate user/1002 &echo()
|
||||
```
|
||||
```
|
||||
originate user/1002 &echo() nose XML nombre 2342343
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Correr los tests
|
||||
```sh
|
||||
python -m unittest tests/response_metadata.py
|
||||
|
|
|
@ -17,4 +17,5 @@ except:
|
|||
raise
|
||||
|
||||
|
||||
print(client.uptime())
|
||||
print(client.call_echo_to_line(1002, 'prueba', '234435345345'))
|
||||
#print(client.uptime())
|
||||
|
|
Loading…
Reference in New Issue