Forfaits VoIP - API "telephony" : Automatisation d'appel AutomaticCall
... / API "telephony" : Automat...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

API "telephony" : Automatisation d'appel AutomaticCall

Von
73aa270c71a785cfcf89
Erstellungsdatum 2023-07-04 10:56:24 (edited on 2024-09-04 13:21:02) in Forfaits VoIP

Ma société possède un abonnement VOIP et notre standard téléphonique passe par cet abonnement.

Je cherche à automatiser un appel avec l’API « telephony » en utilisant un numéro fourni par OVH.

Sur la console web (https://api.ovh.com/console/ dans le navigateur), tout se passe bien lorsque je teste :

POST https://api.ovh.com/console/#/telephony/{billingAccount}/line/{serviceName}/automaticCall

billingAccount = mon identifiant ovhtel (ovhtel-XXXXXX-1)
serviceName = mon numéro de téléphone OVH (00339XXXXXXXX)
bridgeNumberDialplan=NULL, # Number to call if transfer in dialplan selected (type: phoneNumber)
calledNumber='00336XXXXXXXX', # Number to call (type: phoneNumber)
callingNumber= NULL, # Optional, number where the call come from (type: phoneNumber)
dialplan='ReadText', # Dialplan used for the call (type: telephony.CallsGeneratorDialplanEnum)
isAnonymous=False, # For anonymous call (type: boolean)
playbackAudioFileDialplan= NULL, # Name of the audioFile (if needed) with extention. This audio file must have been upload previously (type: string)
timeout=120, # Timeout (in seconds). Default is 20 seconds (type: long)
ttsTextDialplan='. . . . salut . . . comment vas-tu ce matin ? . . . . . . . .', # Text to read if TTS on dialplan selected (type: string)

=> J’obtiens bien un appel sur mon mobile.
L'identifiant de la connexion retourné est : 414025472

Dans mon script PYTHON:
Je me connecte à l'API OVH:

import ovh
client = ovh.Client(
endpoint = 'ovh-eu',
application_key = 'xxxxxxxx',
application_secret = 'xxxxxxxx',
consumer_key = 'xxxxxxxx',
)
client.get('/telephony/ovhtel-XXXXXX-1/line/00339XXXXXXXX')
# OK: J'obtiens une réponse correcte à cette requête
# Je suis donc bien connecté sur l'API OV

client.get('/telephony/ovhtel- XXXXXX -1/line/00339XXXXXXXX'/automaticCall/414025472')
# L'identifiant "414025472" est celui de la connexion via api.ovh.com
# OK: J'obtiens bien un retour JSON me donnant les infos relatives à ma connexion avec succès sur api.ovh.com

client.post('/telephony/ovhtel- XXXXXX -1/line/00339XXXXXXXX'/automaticCall',
bridgeNumberDialplan=None, # Number to call if transfer in dialplan selected (type: phoneNumber)
calledNumber='00336XXXXXXXX', # Number to call (type: phoneNumber)
callingNumber=None, # Optional, number where the call come from (type: phoneNumber)
dialplan='ReadText', # Dialplan used for the call (type: telephony.CallsGeneratorDialplanEnum)
isAnonymous=False, # For anonymous call (type: boolean)
playbackAudioFileDialplan=None, # Name of the audioFile (if needed) with extention. This audio file must have been upload previously (type: string)
timeout=120, # Timeout (in seconds). Default is 20 seconds (type: long)
ttsTextDialplan='. . . . salut . . . comment vas-tu ce matin ? . . . . . . . .', # Text to read if TTS on dialplan selected (type: string)
)
# Je reprends STRICTEMENT les mêmes paramètres que ceux fournis par la console du browser (copier-coller)
# ERREUR: J'obtiens l'exception: "This call has not been granted".

=> Ce retour de l'API m'incite à penser qu'il y un problème de droit, rencontré sur endpoint = 'ovh-eu' mais pas sur "https://api.ovh.com/" ??