- /* create new call instance */
- call = new CallAsterisk(0); // must have no serial, because no endpoint is connected
- if (!call)
- FATAL("No memory for Asterisk Call instance\n");
+ /* find join instance */
+ join = join_first;
+ while(join)
+ {
+ if (join->j_serial == msg->ref)
+ break;
+ join = join->next;
+ }
+
+ /* check application */
+ if (join->j_type != JOIN_TYPE_REMOTE)
+ {
+ PERROR("Ref %d does not belong to a remote join instance.\n", msg->ref);
+ return(-1);
+ }
+ if (!!strcmp(remote, ((class JoinRemote *)join)->j_remote))
+ {
+ PERROR("Ref %d belongs to remote application %s, but not to sending application %s.\n", msg->ref, ((class JoinRemote *)join)->j_remote, remote);
+ return(-1);