M-o-a-T / asyncari

Asterisk Resource Interface for Trio
Other
23 stars 17 forks source link

App hello is split by commas #8

Open mdalius opened 7 months ago

mdalius commented 7 months ago

App hello is split by commas: code:

async def main():
    async with asyncari.connect(ast_url, ast_app, ast_username, ast_password) as client_:
        print(f"TESTTEST2 ast_url: {ast_url}, ast_app: {ast_app}")
        global client
        client = client_
        client.on_channel_event('StasisStart', on_start)
        # Run the WebSocket
        async for m in client:
            print("** EVENT **", m)

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    anyio.run(main)

LOG:

(ari_app3) [root@lab-tst-001 ari_app3]# ./main.py
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:asyncswagger11.client:Loading from http://localhost:8088/ari/api-docs/resources.json
DEBUG:asyncswagger11.client:eventWebsocket?'app=h%2Ce%2Cl%2Cl%2Co'
DEBUG:asyncswagger11.client:GET http://localhost:8088/ari/events({'app': 'h,e,l,l,o'})
TESTTEST2 ast_url: http://localhost:8088/, ast_app: hello
DEBUG:asyncari.client:ADD *
DEBUG:asyncari.client:DISP ***** Dispatch:<EventMessage ApplicationReplaced>
{'_client': <Client:ARI.52a8.65ce016e70e>,
 '_orig_msg': {'application': 'l',
               'asterisk_id': '00:50:56:ad:62:e1',
               'timestamp': '2024-02-15T14:19:58.492+0200',
               'type': 'ApplicationReplaced'},
 'application': 'l',
 'asterisk_id': '00:50:56:ad:62:e1',
 'timestamp': '2024-02-15T14:19:58.492+0200',
 'type': 'ApplicationReplaced'}
** EVENT ** <EventMessage ApplicationReplaced>

If I change in asyncari/client.py apps = ",".join(self._apps) to apps = self._apps It works.

Could it be a bug

crossassembler commented 7 months ago

I have the same question

smurfix commented 6 months ago

0.10.12 should fix this, please test