- if (msg->ref < 2000000000)
- {
- PERROR("Asterisk sends us unknown ref %d below 2000000000.\n", msg->ref);
- return(-1);
- }
+ /* create new join instance */
+ join = new JoinRemote(0, remote_name, sock_id); // must have no serial, because no endpoint is connected
+ if (!join)
+ FATAL("No memory for remote join instance\n");
+ return(0);
+ }
+
+ /* bchannel message
+ * no ref given for *_ack */
+ if (msg->type == MESSAGE_BCHANNEL)
+ if (msg->param.bchannel.type == BCHANNEL_ASSIGN_ACK
+ || msg->param.bchannel.type == BCHANNEL_REMOVE_ACK)
+ {
+ /* no ref, but address */
+ message_bchannel_from_join(NULL, msg->param.bchannel.type, msg->param.bchannel.addr);
+ return(0);
+ }
+
+ /* check for ref */
+ if (!msg->ref)
+ {
+ PERROR("Remote application did not send us a valid ref with a message.\n");
+ return(-1);
+ }