I am trying to use mod_httapi to call multiple SIP endpoints from my script. Here is what the output of my script looks like:

<document type="text/freeswitch-httapi">
   <work>
     <dial context="default" Dialplan="XML">sip:username@ip</dial>
     <dial context="default" Dialplan="XML">sip:username2@ip</dial>
  </work>
</document>

However, I notice that that the dial only gets to the second <dial> endpoint: sip:username2@ip. I suspect it might have to do with sofia because log from fs_cli shows both were processed.

2017-04-06 14:21:29.279911 [DEBUG] mod_httapi.c:1229 Process Tag: [dial]
2017-04-06 14:21:29.279911 [DEBUG] switch_ivr.c:2160 (sofia/internal/number@xxx.com) State Change CS_EXECUTE -> CS_ROUTING
2017-04-06 14:21:29.279911 [NOTICE] switch_ivr.c:2167 Transfer sofia/internal/number@xxx.com to XML[sip:username@ip@public]
2017-04-06 14:21:29.279911 [DEBUG] mod_httapi.c:1229 Process Tag: [dial]
2017-04-06 14:21:29.279911 [NOTICE] switch_ivr.c:2167 Transfer sofia/internal/number@xxx.com to XML[sip:username2@ip@public]

Any ideas what could be wrong? Or a better way to do this?

Thanks