transfer-unattended.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #
  2. import inc_const as const
  3. PJSUA = ["--null-audio", # UA0
  4. "--null-audio", # UA1
  5. "--null-audio" # UA2
  6. ]
  7. PJSUA_EXPECTS = [
  8. # A calls B
  9. [0, "", "m"],
  10. [0, "", "$PJSUA_URI[1]"],
  11. [0, const.STATE_CALLING, ""],
  12. [1, const.EVENT_INCOMING_CALL, "a"],
  13. [1, "", "200"],
  14. [0, const.STATE_CONFIRMED, ""],
  15. [1, const.STATE_CONFIRMED, ""],
  16. # B transfer A to C
  17. [1, "", "x"],
  18. [1, "", "$PJSUA_URI[2]"],
  19. [0, const.STATE_CALLING, ""],
  20. [2, const.EVENT_INCOMING_CALL, "a"],
  21. [2, "", "200"],
  22. [0, const.MEDIA_ACTIVE, ""],
  23. [2, const.MEDIA_ACTIVE, ""],
  24. [1, "call transferred successfully", ""],
  25. [1, const.STATE_DISCONNECTED, ""]
  26. ]
  27. PJSUA_CLI_EXPECTS = [
  28. # A calls B
  29. [0, "", "call new $PJSUA_URI[1]"],
  30. [0, const.STATE_CALLING, ""],
  31. [1, const.EVENT_INCOMING_CALL, "call answer 200"],
  32. [0, const.STATE_CONFIRMED, ""],
  33. [1, const.STATE_CONFIRMED, ""],
  34. # B transfer A to C
  35. [1, "", "call transfer $PJSUA_URI[2]"],
  36. [0, const.STATE_CALLING, ""],
  37. [2, const.EVENT_INCOMING_CALL, "call answer 200"],
  38. [0, const.MEDIA_ACTIVE, ""],
  39. [2, const.MEDIA_ACTIVE, ""],
  40. [1, "call transferred successfully", ""],
  41. [1, const.STATE_DISCONNECTED, ""]
  42. ]